]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Admin/Queue.php
Changes:
[friendica.git] / src / Module / Admin / Queue.php
index b6e7d122fb9e17e742683ff3faf19d86fa44e2d0..54d70b27d90ac9a46287f11ce0ff2ac6c108c05d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -38,17 +38,14 @@ use Friendica\Util\DateTimeFormat;
  */
 class Queue extends BaseAdmin
 {
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
-               parent::content($parameters);
+               parent::content();
 
-               $a = DI::app();
-
-               // @TODO: Replace with parameter from router
-               $deferred = $a->argc > 2 && $a->argv[2] == 'deferred';
+               $status = $this->parameters['status'] ?? '';
 
                // get jobs from the workerqueue table
-               if ($deferred) {
+               if ($status == 'deferred') {
                        $condition = ["NOT `done` AND `retrial` > ?", 0];
                        $sub_title = DI::l10n()->t('Inspect Deferred Worker Queue');
                        $info = DI::l10n()->t("This page lists the deferred worker jobs. This are jobs that couldn't be executed at the first time.");
@@ -59,7 +56,7 @@ class Queue extends BaseAdmin
                }
 
                // @TODO Move to Model\WorkerQueue::getEntries()
-               $entries = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority'], $condition, ['limit' => 999, 'order' => ['created']]);
+               $entries = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority', 'command'], $condition, ['limit' => 999, 'order' => ['created']]);
 
                $r = [];
                while ($entry = DBA::fetch($entries)) {
@@ -76,6 +73,7 @@ class Queue extends BaseAdmin
                        '$page' => $sub_title,
                        '$count' => count($r),
                        '$id_header' => DI::l10n()->t('ID'),
+                       '$command_header' => DI::l10n()->t('Command'),
                        '$param_header' => DI::l10n()->t('Job Parameters'),
                        '$created_header' => DI::l10n()->t('Created'),
                        '$prio_header' => DI::l10n()->t('Priority'),