schedule the queue re-delivery process
This commit is contained in:
parent
0bcb68200e
commit
fb58801aa4
|
@ -258,7 +258,13 @@
|
||||||
|
|
||||||
if($deliver_status == (-1)) {
|
if($deliver_status == (-1)) {
|
||||||
// queue message for redelivery
|
// queue message for redelivery
|
||||||
|
q("INSERT INTO `queue` ( `cid`, `created`, `last`, `content`)
|
||||||
|
VALUES ( %d, '%s', '%s', '%s') ",
|
||||||
|
intval($contact['id']),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc($atom)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -269,6 +275,13 @@
|
||||||
|
|
||||||
if($deliver_status == (-1)) {
|
if($deliver_status == (-1)) {
|
||||||
// queue message for redelivery
|
// queue message for redelivery
|
||||||
|
q("INSERT INTO `queue` ( `cid`, `created`, `last`, `content`)
|
||||||
|
VALUES ( %d, '%s', '%s', '%s') ",
|
||||||
|
intval($contact['id']),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc($slap)
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,9 +299,13 @@
|
||||||
$deliver_status = slapper($owner,$contact['notify'],$slappy);
|
$deliver_status = slapper($owner,$contact['notify'],$slappy);
|
||||||
if($deliver_status == (-1)) {
|
if($deliver_status == (-1)) {
|
||||||
// queue message for redelivery
|
// queue message for redelivery
|
||||||
// if not already in queue
|
q("INSERT INTO `queue` ( `cid`, `created`, `last`, `content`)
|
||||||
// else if deliver_status ok and queued, remove from queue
|
VALUES ( %d, '%s', '%s', '%s') ",
|
||||||
|
intval($contact['id']),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc($slappy)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,6 +331,7 @@
|
||||||
foreach($slaps as $slappy) {
|
foreach($slaps as $slappy) {
|
||||||
if($url) {
|
if($url) {
|
||||||
$deliver_status = slapper($owner,$url,$slappy);
|
$deliver_status = slapper($owner,$url,$slappy);
|
||||||
|
// TODO: redeliver/queue these items on failure, though there is no contact record
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,13 @@
|
||||||
|
|
||||||
$a->set_baseurl(get_config('system','url'));
|
$a->set_baseurl(get_config('system','url'));
|
||||||
|
|
||||||
|
|
||||||
|
// run queue delivery process in the background
|
||||||
|
|
||||||
|
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
|
||||||
|
proc_close(proc_open("\"$php_path\" \"include/queue.php\" &", array(), $foo));
|
||||||
|
|
||||||
|
|
||||||
$force = false;
|
$force = false;
|
||||||
if(($argc > 1) && ($argv[1] == 'force'))
|
if(($argc > 1) && ($argv[1] == 'force'))
|
||||||
$force = true;
|
$force = true;
|
||||||
|
|
|
@ -45,7 +45,7 @@ function remove_queue_item($id) {
|
||||||
q("DELETE FROM `queue` WHERE `created` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
|
q("DELETE FROM `queue` WHERE `created` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT `id` FROM `queue` WHERE 1 ");
|
$r = q("SELECT `id` FROM `queue` WHERE `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ");
|
||||||
|
|
||||||
if(! count($r))
|
if(! count($r))
|
||||||
killme();
|
killme();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user