mirror of
https://github.com/friendica/friendica
synced 2025-04-27 07:50:10 +00:00
Dynamic priority handling
This commit is contained in:
parent
6a8c85fac4
commit
f4a71b76dd
2 changed files with 7 additions and 3 deletions
|
@ -18,10 +18,14 @@ class PushSubscriber
|
|||
{
|
||||
// We'll push to each subscriber that has push > 0,
|
||||
// i.e. there has been an update (set in notifier.php).
|
||||
$subscribers = dba::select('push_subscriber', ['id', 'callback_url'], ["`push` > 0 AND `next_try` < UTC_TIMESTAMP()"]);
|
||||
$subscribers = dba::select('push_subscriber', ['id', 'push', 'callback_url'], ["`push` > 0 AND `next_try` < UTC_TIMESTAMP()"]);
|
||||
|
||||
while ($subscriber = dba::fetch($subscribers)) {
|
||||
logger("Publish feed to " . $subscriber["callback_url"], LOGGER_DEBUG);
|
||||
// We always handle retries with low priority
|
||||
if ($subscriber["push"] > 1) {
|
||||
$priority = PRIORITY_LOW;
|
||||
}
|
||||
logger("Publish feed to " . $subscriber["callback_url"] . " with priority " . $priority, LOGGER_DEBUG);
|
||||
Worker::add($priority, 'PubSubPublish', (int)$subscriber["id"]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue