Merge pull request #13348 from annando/retrial
New function for the number of retrials / Daily reload of hooks
This commit is contained in:
commit
b5f33124be
|
@ -1365,6 +1365,17 @@ class Worker
|
||||||
return $new_retrial;
|
return $new_retrial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of retrials for the current worker task
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public static function getRetrial(): int
|
||||||
|
{
|
||||||
|
$queue = DI::app()->getQueue();
|
||||||
|
return $queue['retrial'] ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defers the current worker entry
|
* Defers the current worker entry
|
||||||
*
|
*
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Worker;
|
namespace Friendica\Worker;
|
||||||
|
|
||||||
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
|
@ -146,6 +147,8 @@ class Cron
|
||||||
// Update "blocked" status of servers
|
// Update "blocked" status of servers
|
||||||
Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers');
|
Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers');
|
||||||
|
|
||||||
|
Addon::reload();
|
||||||
|
|
||||||
DI::keyValue()->set('last_cron_daily', time());
|
DI::keyValue()->set('last_cron_daily', time());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user