X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fcron.php;h=01989826da28716ea14ddeecdd3719824e18464b;hb=799c67c141bc33686996774e0e53ebc63bc8b881;hp=8bc83a37214abf7c924afd302b8c1e75dde41e53;hpb=f2f20c85d54766186812710baf06c9c6ea2c1edc;p=friendica.git diff --git a/include/cron.php b/include/cron.php index 8bc83a3721..01989826da 100644 --- a/include/cron.php +++ b/include/cron.php @@ -1,5 +1,8 @@ = 0) && !$force) { $update = false; $t = $contact['last-update']; @@ -224,11 +229,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 . " + ".$min_poll_interval." minute")) { + $update = true; + } + break; } if (!$update) { continue; @@ -237,11 +247,12 @@ function cron_poll_contacts($argc, $argv) { logger("Polling " . $contact["network"] . " " . $contact["id"] . " " . $contact["nick"] . " " . $contact["name"]); - if (($contact['network'] == NETWORK_FEED) AND ($contact['priority'] <= 3)) { - proc_run(PRIORITY_MEDIUM, 'include/onepoll.php', intval($contact['id'])); + if (($contact['network'] == NETWORK_FEED) && ($contact['priority'] <= 3)) { + $priority = PRIORITY_MEDIUM; } else { - proc_run(PRIORITY_LOW, 'include/onepoll.php', intval($contact['id'])); + $priority = PRIORITY_LOW; } + Worker::add(array('priority' => $priority, 'dont_fork' => true), 'OnePoll', (int)$contact['id']); } } }