allow zero delivery interval on dedicated servers
This commit is contained in:
parent
391330d95f
commit
177e0e15d7
2 changed files with 8 additions and 9 deletions
|
@ -384,9 +384,7 @@ function notifier_run($argv, $argc){
|
||||||
|
|
||||||
require_once('include/salmon.php');
|
require_once('include/salmon.php');
|
||||||
|
|
||||||
$interval = intval(get_config('system','delivery_interval'));
|
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
|
||||||
if(! $interval)
|
|
||||||
$interval = 2;
|
|
||||||
|
|
||||||
// delivery loop
|
// delivery loop
|
||||||
|
|
||||||
|
@ -411,6 +409,7 @@ function notifier_run($argv, $argc){
|
||||||
|
|
||||||
if((! $mail) && (! $fsuggest) && (! $followup)) {
|
if((! $mail) && (! $fsuggest) && (! $followup)) {
|
||||||
proc_run('php','include/delivery.php',$cmd,$item_id,$contact['id']);
|
proc_run('php','include/delivery.php',$cmd,$item_id,$contact['id']);
|
||||||
|
if($interval)
|
||||||
@time_sleep_until(microtime(true) + (float) $interval);
|
@time_sleep_until(microtime(true) + (float) $interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -661,6 +660,7 @@ function notifier_run($argv, $argc){
|
||||||
if((! $mail) && (! $fsuggest) && (! $followup)) {
|
if((! $mail) && (! $fsuggest) && (! $followup)) {
|
||||||
logger('notifier: delivery agent: ' . $rr['name'] . ' ' . $rr['id']);
|
logger('notifier: delivery agent: ' . $rr['name'] . ' ' . $rr['id']);
|
||||||
proc_run('php','include/delivery.php',$cmd,$item_id,$rr['id']);
|
proc_run('php','include/delivery.php',$cmd,$item_id,$rr['id']);
|
||||||
|
if($interval)
|
||||||
@time_sleep_until(microtime(true) + (float) $interval);
|
@time_sleep_until(microtime(true) + (float) $interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,15 +38,14 @@ function queue_run($argv, $argc){
|
||||||
|
|
||||||
logger('queue: start');
|
logger('queue: start');
|
||||||
|
|
||||||
$interval = intval(get_config('system','delivery_interval'));
|
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
|
||||||
if(! $interval)
|
|
||||||
$interval = 2;
|
|
||||||
|
|
||||||
$r = q("select * from deliverq where 1");
|
$r = q("select * from deliverq where 1");
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
logger('queue: deliverq');
|
logger('queue: deliverq');
|
||||||
proc_run('php','include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']);
|
proc_run('php','include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']);
|
||||||
|
if($interval)
|
||||||
@time_sleep_until(microtime(true) + (float) $interval);
|
@time_sleep_until(microtime(true) + (float) $interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue