Commit 2cc1a1b9 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(filter, alias) fix empty update frequency, excessive downloads

(cherry picked from commit 2ba1c056)
parent 325dcf4f
......@@ -481,9 +481,13 @@ function process_alias_urltable($name, $url, $freq, $forceupdate=false) {
unlink($urltable_prefix);
mkdir($urltable_prefix);
}
if (empty($freq)) {
$update_freq = 86400 - 90;
} else {
$update_freq = $freq * 86400 - 90;
}
// If the file doesn't exist or is older than update_freq days, fetch a new copy.
if (!file_exists($urltable_filename) || ((time() - filemtime($urltable_filename)) > ($freq * 86400 - 90)) || $forceupdate) {
if (!file_exists($urltable_filename) || ((time() - filemtime($urltable_filename)) > $update_freq) || $forceupdate) {
// open file handle to output file, in case the process takes a lot of time, make sure there's a file before
// filter starts to load. Also helps for tracking progress.
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment