Merge pull request #385 from fermionic/peculiar-queue-hangup
Prevent long delays in Diaspora delivery
This commit is contained in:
commit
61ff2ecab2
|
@ -2517,7 +2517,7 @@ function diaspora_send_mail($item,$owner,$contact) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function diaspora_transmit($owner,$contact,$slap,$public_batch) {
|
function diaspora_transmit($owner,$contact,$slap,$public_batch,$queue_run=false) {
|
||||||
|
|
||||||
$enabled = intval(get_config('system','diaspora_enabled'));
|
$enabled = intval(get_config('system','diaspora_enabled'));
|
||||||
if(! $enabled) {
|
if(! $enabled) {
|
||||||
|
@ -2534,7 +2534,7 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch) {
|
||||||
|
|
||||||
logger('diaspora_transmit: ' . $logid . ' ' . $dest_url);
|
logger('diaspora_transmit: ' . $logid . ' ' . $dest_url);
|
||||||
|
|
||||||
if(was_recently_delayed($contact['id'])) {
|
if( (! $queue_run) && (was_recently_delayed($contact['id'])) ) {
|
||||||
$return_code = 0;
|
$return_code = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -73,5 +73,3 @@ function unlock_function($fn_name) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ function queue_run($argv, $argc){
|
||||||
case NETWORK_DIASPORA:
|
case NETWORK_DIASPORA:
|
||||||
if($contact['notify']) {
|
if($contact['notify']) {
|
||||||
logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name']);
|
logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name']);
|
||||||
$deliver_status = diaspora_transmit($owner,$contact,$data,$public);
|
$deliver_status = diaspora_transmit($owner,$contact,$data,$public,true);
|
||||||
|
|
||||||
if($deliver_status == (-1))
|
if($deliver_status == (-1))
|
||||||
update_queue_time($q_item['id']);
|
update_queue_time($q_item['id']);
|
||||||
|
|
Loading…
Reference in a new issue