Don't use a delivery interval when using the worker

This commit is contained in:
Michael Vogel 2015-09-12 18:08:03 +02:00
parent 0a2c161230
commit 7edce8e266
4 changed files with 13 additions and 1 deletions

View file

@ -215,6 +215,10 @@ function cron_run(&$argv, &$argc){
if(! $interval) if(! $interval)
$interval = ((get_config('system','delivery_interval') === false) ? 3 : intval(get_config('system','delivery_interval'))); $interval = ((get_config('system','delivery_interval') === false) ? 3 : intval(get_config('system','delivery_interval')));
// If we are using the worker we don't need a delivery interval
if (get_config("system", "worker"))
$interval = false;
$sql_extra = (($manual_id) ? " AND `id` = $manual_id " : ""); $sql_extra = (($manual_id) ? " AND `id` = $manual_id " : "");
reload_plugins(); reload_plugins();

View file

@ -615,6 +615,10 @@ function notifier_run(&$argv, &$argc){
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval'))); $interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
// If we are using the worker we don't need a delivery interval
if (get_config("system", "worker"))
$interval = false;
// delivery loop // delivery loop
if(count($r)) { if(count($r)) {

View file

@ -39,7 +39,7 @@ function poller_run(&$argv, &$argc){
} else } else
// Sleep two seconds before checking for running processes to avoid having too many workers // Sleep two seconds before checking for running processes to avoid having too many workers
sleep(2); sleep(4);
// Checking number of workers // Checking number of workers
$workers = q("SELECT COUNT(*) AS `workers` FROM `workerqueue` WHERE `executed` != '0000-00-00 00:00:00'"); $workers = q("SELECT COUNT(*) AS `workers` FROM `workerqueue` WHERE `executed` != '0000-00-00 00:00:00'");

View file

@ -60,6 +60,10 @@ function queue_run(&$argv, &$argc){
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval'))); $interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
// If we are using the worker we don't need a delivery interval
if (get_config("system", "worker"))
$interval = false;
$r = q("select * from deliverq where 1"); $r = q("select * from deliverq where 1");
if($r) { if($r) {
foreach($r as $rr) { foreach($r as $rr) {