From 2b0404fefc69678db7afa5e1f25a5f1fabd50907 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 22 Dec 2022 13:29:34 +0000 Subject: queueworker: add some more details --- Zotlabs/Module/Queueworker.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Queueworker.php b/Zotlabs/Module/Queueworker.php index 7c5e4f1cf..0e0529bc0 100644 --- a/Zotlabs/Module/Queueworker.php +++ b/Zotlabs/Module/Queueworker.php @@ -51,22 +51,24 @@ class Queueworker extends Controller { $content = "

Queue Status

\n"; - $r = q('select count(*) as qentries from workerq'); + $r = q('select count(*) as total from workerq'); - if (!$r) { - $content = "

There was an error querying the database.

"; - return $content; - } - - $content .= "

There are " . $r[0]['qentries'] . " queue items to be processed.

"; + $content .= "

There are " . $r[0]['total'] . " queue items to be processed.

"; $r = dbq("select count(distinct workerq_reservationid) as qworkers from workerq where workerq_reservationid is not null"); $content .= "

Active workers: " . $r[0]['qworkers'] . "

"; + $r = dbq("select workerq_cmd, count(*) as total from workerq where true group by workerq_cmd"); + + $content .= "

Work items

"; + + foreach($r as $rr) { + $content .= $rr['workerq_cmd'] . ': ' . $rr['total'] . '
'; + } + $maxqueueworkers = get_config('queueworker', 'max_queueworkers', 4); $maxqueueworkers = ($maxqueueworkers > 3) ? $maxqueueworkers : 4; - //set_config('queueworker', 'max_queueworkers', $maxqueueworkers); $sc = ''; @@ -81,7 +83,6 @@ class Queueworker extends Controller { $workermaxage = get_config('queueworker', 'queueworker_max_age'); $workermaxage = ($workermaxage >= 120) ? $workermaxage : 300; - //set_config('queueworker', 'max_queueworker_age', $workermaxage); $sc .= replace_macros(get_markup_template('field_input.tpl'), [ '$field' => [ @@ -94,7 +95,6 @@ class Queueworker extends Controller { $queueworkersleep = get_config('queueworker', 'queue_worker_sleep'); $queueworkersleep = ($queueworkersleep > 100) ? $queueworkersleep : 100; - //set_config('queueworker', 'queue_worker_sleep', $queueworkersleep); $sc .= replace_macros(get_markup_template('field_input.tpl'), [ '$field' => [ -- cgit v1.2.3