diff options
author | smos <seth.mos@dds.nl> | 2012-03-15 14:47:41 +0100 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2012-03-15 14:47:41 +0100 |
commit | 56ee96ed9dcce0eb3c2a9bf8dcd22e7fd0208733 (patch) | |
tree | 35a4092359c9d4d7e95aea0b7e239707c6587c6f | |
parent | d6425f758200e7e4d64aa3e3b6ea3c0ce3067dc0 (diff) | |
download | pfsense-56ee96ed9dcce0eb3c2a9bf8dcd22e7fd0208733.zip pfsense-56ee96ed9dcce0eb3c2a9bf8dcd22e7fd0208733.tar.gz |
More memory optimizations for the RRD upgrade. Ticket #1758 #2159
-rw-r--r-- | etc/inc/upgrade_config.inc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 89aec16..5fb4209 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -2041,12 +2041,10 @@ function upgrade_054_to_055() { $i++; } - $rrdxml = dump_xml_config_raw($rrdold, "rrd"); - file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", $rrdxml); + file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", dump_xml_config_raw($rrdold, "rrd")); mwexec("$rrdtool restore -f {$g['tmp_path']}/{$xmldumpnew} {$rrddbpath}/{$database} 2>&1"); unset($rrdold); - unset($rrdxmlarray); } /* let apinger recreate required files */ setup_gateways_monitor(); @@ -2100,10 +2098,7 @@ function upgrade_054_to_055() { $i++; } - $rrdxmlarray = migrate_rrd_format($rrdold, $rrdnew); - unset($rrdold); - unset($rrdnew); - file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", dump_xml_config_raw($rrdxmlarray, "rrd")); + file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", dump_xml_config_raw(migrate_rrd_format($rrdold, $rrdnew), "rrd")); mwexec("$rrdtool restore -f {$g['tmp_path']}/{$xmldumpnew} {$rrddbpath}/{$database} 2>&1"); /* we now have the rrd with the new fields, adjust the size now. */ /* RRA 2 is 60 minutes, RRA 3 is 720 minutes */ @@ -2704,12 +2699,8 @@ function upgrade_080_to_081() { $i++; } - $rrdxmlarray = migrate_rrd_format($rrdold, $rrdnew); - unset($rrdold); - unset($rrdnew); - file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", dump_xml_config_raw($rrdxmlarray, "rrd")); + file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", dump_xml_config_raw(migrate_rrd_format($rrdold, $rrdnew);, "rrd")); mwexec("$rrdtool restore -f {$g['tmp_path']}/{$xmldumpnew} {$rrddbpath}/{$database} 2>&1"); - unset($rrdxmlarray); } enable_rrd_graphing(); |