X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fcron.php;h=8b0fab77abfefedc5b0dc1c92abf016a03f3b794;hb=69afe503453ab19d6d5137301f9ed9c5f210ca46;hp=3702bf8b36707dfae5f3d1113602c0318d2634b2;hpb=d649873f804f9ed77e69ef6cd12af4a263233945;p=friendica.git diff --git a/include/cron.php b/include/cron.php index 3702bf8b36..8b0fab77ab 100644 --- a/include/cron.php +++ b/include/cron.php @@ -42,12 +42,6 @@ function cron_run(&$argv, &$argc){ // Expire and remove user entries proc_run(PRIORITY_MEDIUM, "include/cronjobs.php", "expire_and_remove_users"); - // Check OStatus conversations - proc_run(PRIORITY_MEDIUM, "include/cronjobs.php", "ostatus_mentions"); - - // Check every conversation - proc_run(PRIORITY_MEDIUM, "include/cronjobs.php", "ostatus_conversations"); - // Call possible post update functions proc_run(PRIORITY_LOW, "include/cronjobs.php", "post_update"); @@ -82,6 +76,9 @@ function cron_run(&$argv, &$argc){ proc_run(PRIORITY_MEDIUM, 'include/dbclean.php'); proc_run(PRIORITY_LOW, "include/cronjobs.php", "update_photo_albums"); + + // Delete all done workerqueue entries + dba::delete('workerqueue', array('`done` AND `executed` < UTC_TIMESTAMP() - INTERVAL 12 HOUR')); } // Poll contacts @@ -186,7 +183,7 @@ function cron_poll_contacts($argc, $argv) { $contact['priority'] = 2; } - if ($contact['subhub'] AND in_array($contact['network'], array(NETWORK_DFRN, NETWORK_ZOT, NETWORK_OSTATUS))) { + if ($contact['subhub'] && in_array($contact['network'], array(NETWORK_DFRN, NETWORK_ZOT, NETWORK_OSTATUS))) { /* * We should be getting everything via a hub. But just to be sure, let's check once a day. * (You can make this more or less frequent if desired by setting 'pushpoll_frequency' appropriately) @@ -197,7 +194,7 @@ function cron_poll_contacts($argc, $argv) { $contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3); } - if (($contact['priority'] >= 0) AND !$force) { + if (($contact['priority'] >= 0) && !$force) { $update = false; $t = $contact['last-update']; @@ -245,11 +242,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; } + proc_run(array('priority' => $priority, 'dont_fork' => true), 'include/onepoll.php', (int)$contact['id']); } } }