X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fcron.php;h=eda88dbcd3f17e307bfebcff6fd35308a5d5ced2;hb=8cb4a8d0c420dc7c7fe9b96a43b78016c105a8fc;hp=1af63ffaaff36051b72f1b6a0af9851a3ddf2428;hpb=8191bcc402224cfb4ef5eda3619f14751dbeb555;p=friendica.git diff --git a/include/cron.php b/include/cron.php index 1af63ffaaf..eda88dbcd3 100644 --- a/include/cron.php +++ b/include/cron.php @@ -1,5 +1,6 @@ = 0) && !$force) { $update = false; $t = $contact['last-update']; @@ -224,11 +230,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,15 +248,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'])); - } - - if ($interval) { - time_sleep_until(microtime(true) + (float) $interval); + $priority = PRIORITY_LOW; } + proc_run(array('priority' => $priority, 'dont_fork' => true), 'include/onepoll.php', (int)$contact['id']); } } }