Optimized priorities for the automated expiring of items

This commit is contained in:
Michael 2017-05-24 06:29:47 +00:00
parent 471056e989
commit d7de7bb70a
3 changed files with 32 additions and 12 deletions

View file

@ -195,7 +195,7 @@ function cron_poll_contacts($argc, $argv) {
$contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3);
}
if ($contact['priority'] AND !$force) {
if (($contact['priority'] >= 0) AND !$force) {
$update = false;
$t = $contact['last-update'];
@ -225,11 +225,16 @@ function cron_poll_contacts($argc, $argv) {
}
break;
case 1:
default:
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 hour")) {
$update = true;
}
break;
case 0:
default:
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 15 minute")) {
$update = true;
}
break;
}
if (!$update) {
continue;