Browse Source

allow zero delivery interval on dedicated servers

pull/1/head
Friendika 9 years ago
parent
commit
177e0e15d7
2 changed files with 8 additions and 9 deletions
  1. +5
    -5
      include/notifier.php
  2. +3
    -4
      include/queue.php

+ 5
- 5
include/notifier.php View File

@ -384,9 +384,7 @@ function notifier_run($argv, $argc){
require_once('include/salmon.php');
$interval = intval(get_config('system','delivery_interval'));
if(! $interval)
$interval = 2;
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
// delivery loop
@ -411,7 +409,8 @@ function notifier_run($argv, $argc){
if((! $mail) && (! $fsuggest) && (! $followup)) {
proc_run('php','include/delivery.php',$cmd,$item_id,$contact['id']);
@time_sleep_until(microtime(true) + (float) $interval);
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}
$deliver_status = 0;
@ -661,7 +660,8 @@ function notifier_run($argv, $argc){
if((! $mail) && (! $fsuggest) && (! $followup)) {
logger('notifier: delivery agent: ' . $rr['name'] . ' ' . $rr['id']);
proc_run('php','include/delivery.php',$cmd,$item_id,$rr['id']);
@time_sleep_until(microtime(true) + (float) $interval);
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}
}
}


+ 3
- 4
include/queue.php View File

@ -38,16 +38,15 @@ function queue_run($argv, $argc){
logger('queue: start');
$interval = intval(get_config('system','delivery_interval'));
if(! $interval)
$interval = 2;
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
$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);
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}
}


Loading…
Cancel
Save