mirror of
https://github.com/friendica/friendica
synced 2025-04-26 07:50:15 +00:00
implement delivery queue in case notifier gets killed
This commit is contained in:
parent
f29f228463
commit
846c4cea7c
8 changed files with 74 additions and 20 deletions
|
@ -38,6 +38,20 @@ function queue_run($argv, $argc){
|
|||
|
||||
logger('queue: start');
|
||||
|
||||
$interval = intval(get_config('system','delivery_interval'));
|
||||
if(! $interval)
|
||||
$interval = 2;
|
||||
|
||||
|
||||
$r = q("select * from deliverq where 1");
|
||||
if(count($r)) {
|
||||
foreach($r as $rr) {
|
||||
logger('queue: deliverq');
|
||||
proc_run('php','include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']);
|
||||
@time_sleep_until(microtime(true) + (float) $interval);
|
||||
}
|
||||
}
|
||||
|
||||
$r = q("SELECT `queue`.*, `contact`.`name`, `contact`.`uid` FROM `queue`
|
||||
LEFT JOIN `contact` ON `queue`.`cid` = `contact`.`id`
|
||||
WHERE `queue`.`created` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue