mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
(filter, alias) fix empty update frequency, excessive downloads
This commit is contained in:
parent
254852669a
commit
2ba1c05604
@ -458,9 +458,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.
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user