X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FPollContacts.php;h=eb092fe2cd5e42adea071d72c0f1351fcc637d24;hb=44b2b97e80624aca5768511def80a95f0e6e0381;hp=da4ac21420449f49d189667bfed366ed6e859903;hpb=53e38b03130ea798bba44db44ccb7f331dc4b91d;p=friendica.git diff --git a/src/Worker/PollContacts.php b/src/Worker/PollContacts.php index da4ac21420..eb092fe2cd 100644 --- a/src/Worker/PollContacts.php +++ b/src/Worker/PollContacts.php @@ -1,6 +1,6 @@ UTC_TIMESTAMP() - INTERVAL ? DAY)", 0, $abandon_days]); + ["`uid` != ? AND `uid` IN (SELECT `uid` FROM `user` WHERE NOT `account_expired` AND NOT `account_removed` AND `last-activity` > ?)", 0, DateTimeFormat::utc('now - ' . $abandon_days . ' days')]); } else { $condition = DBA::mergeConditions($condition, ["`uid` != ? AND `uid` IN (SELECT `uid` FROM `user` WHERE NOT `account_expired` AND NOT `account_removed`)", 0]); @@ -71,16 +71,17 @@ class PollContacts } if ((($contact['network'] == Protocol::FEED) && ($contact['priority'] <= 3)) || ($contact['network'] == Protocol::MAIL)) { - $priority = PRIORITY_MEDIUM; + $priority = Worker::PRIORITY_MEDIUM; } elseif ($contact['archive']) { - $priority = PRIORITY_NEGLIGIBLE; + $priority = Worker::PRIORITY_NEGLIGIBLE; } else { - $priority = PRIORITY_LOW; + $priority = Worker::PRIORITY_LOW; } Logger::notice("Polling " . $contact["network"] . " " . $contact["id"] . " " . $contact['priority'] . " " . $contact["nick"] . " " . $contact["name"]); Worker::add(['priority' => $priority, 'dont_fork' => true, 'force_priority' => true], 'OnePoll', (int)$contact['id']); + Worker::coolDown(); } DBA::close($contacts); }