Merge pull request #7505 from annando/admin-queue

Queue numbers corrected, only display 999 queue items
2022.09-rc
Hypolite Petovan 2019-08-12 19:30:57 -04:00 zatwierdzone przez GitHub
commit 2f752b18e1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 5 dodań i 7 usunięć

Wyświetl plik

@ -30,17 +30,17 @@ class Queue extends BaseAdminModule
// get jobs from the workerqueue table // get jobs from the workerqueue table
if ($deferred) { if ($deferred) {
$condition = ["NOT `done` AND `next_try` > ?", DateTimeFormat::utcNow()]; $condition = ["NOT `done` AND `retrial` > ?", 0];
$sub_title = L10n::t('Inspect Deferred Worker Queue'); $sub_title = L10n::t('Inspect Deferred Worker Queue');
$info = L10n::t("This page lists the deferred worker jobs. This are jobs that couldn't be executed at the first time."); $info = L10n::t("This page lists the deferred worker jobs. This are jobs that couldn't be executed at the first time.");
} else { } else {
$condition = ["NOT `done` AND `next_try` < ?", DateTimeFormat::utcNow()]; $condition = ["NOT `done` AND `retrial` = ?", 0];
$sub_title = L10n::t('Inspect Worker Queue'); $sub_title = L10n::t('Inspect Worker Queue');
$info = L10n::t('This page lists the currently queued worker jobs. These jobs are handled by the worker cronjob you\'ve set up during install.'); $info = L10n::t('This page lists the currently queued worker jobs. These jobs are handled by the worker cronjob you\'ve set up during install.');
} }
// @TODO Move to Model\WorkerQueue::getEntries() // @TODO Move to Model\WorkerQueue::getEntries()
$entries = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority'], $condition, ['order' => ['priority']]); $entries = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority'], $condition, ['limit' => 999, 'order' => ['created']]);
$r = []; $r = [];
while ($entry = DBA::fetch($entries)) { while ($entry = DBA::fetch($entries)) {

Wyświetl plik

@ -146,11 +146,9 @@ class Summary extends BaseAdminModule
$pending = Register::getPendingCount(); $pending = Register::getPendingCount();
$deferred = DBA::count('workerqueue', ['`executed` <= ? AND NOT `done` AND `next_try` > ?', $deferred = DBA::count('workerqueue', ['NOT `done` AND `retrial` > ?', 0]);
DBA::NULL_DATETIME, DateTimeFormat::utcNow()]);
$workerqueue = DBA::count('workerqueue', ['`executed` <= ? AND NOT `done` AND `next_try` < ?', $workerqueue = DBA::count('workerqueue', ['NOT `done` AND `retrial` = ?', 0]);
DBA::NULL_DATETIME, DateTimeFormat::utcNow()]);
// We can do better, but this is a quick queue status // We can do better, but this is a quick queue status
$queues = ['label' => L10n::t('Message queues'), 'deferred' => $deferred, 'workerq' => $workerqueue]; $queues = ['label' => L10n::t('Message queues'), 'deferred' => $deferred, 'workerq' => $workerqueue];