]> git.mxchange.org Git - friendica.git/blobdiff - include/cron.php
Fetching new queue tasks in a bulk to increase speed
[friendica.git] / include / cron.php
index 3702bf8b36707dfae5f3d1113602c0318d2634b2..76f3e410196185514b9c24a12ef8ff3c6d8e8d62 100644 (file)
@@ -186,7 +186,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 +197,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 +245,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', intval($contact['id']));
                }
        }
 }