]> git.mxchange.org Git - friendica.git/commitdiff
allow zero delivery interval on dedicated servers
authorFriendika <info@friendika.com>
Mon, 29 Aug 2011 07:59:44 +0000 (00:59 -0700)
committerFriendika <info@friendika.com>
Mon, 29 Aug 2011 07:59:44 +0000 (00:59 -0700)
include/notifier.php
include/queue.php

index aa186317f967de1eb736a2360c944b205f44da34..1c71538d70a03d1c22919cff526b6d3ccf4983a5 100644 (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);
                                }
                        }
                }
index 1ac1e7d48c6db3f000847977b6c69f1ef081bc20..5119a65d8cebaee58cbb8cd007d734541180203a 100644 (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);
                }
        }