diff --git a/lib/Alchemy/Phrasea/Model/Repositories/WorkerRunningJobRepository.php b/lib/Alchemy/Phrasea/Model/Repositories/WorkerRunningJobRepository.php index 4c7f9d711a..da456ffaa6 100644 --- a/lib/Alchemy/Phrasea/Model/Repositories/WorkerRunningJobRepository.php +++ b/lib/Alchemy/Phrasea/Model/Repositories/WorkerRunningJobRepository.php @@ -393,7 +393,8 @@ class WorkerRunningJobRepository extends EntityRepository $rsm->addScalarResult('duration', 'duration'); $rsm->addScalarResult('status', 'status'); - $sql = "SELECT info, databox_id as databoxId, record_id as recordId, work, work_on as workOn, published, created, finished, status, TIMESTAMPDIFF(SECOND, w.created, w.finished) as duration \n" + $sql = "SELECT info, databox_id as databoxId, record_id as recordId, work, work_on as workOn, published, created, finished, status, \n" + . "IF(w.finished IS NULL, TIMESTAMPDIFF(SECOND, w.created, NOW()), TIMESTAMPDIFF(SECOND, w.created, w.finished)) as duration \n" . "FROM WorkerRunningJob w \n" . "WHERE 1"; diff --git a/templates/web/admin/worker-manager/worker_info.html.twig b/templates/web/admin/worker-manager/worker_info.html.twig index 6cdf03a26a..7fc32acd86 100644 --- a/templates/web/admin/worker-manager/worker_info.html.twig +++ b/templates/web/admin/worker-manager/worker_info.html.twig @@ -134,9 +134,9 @@ {% endif %} - {% if workerRow.duration is not empty %} + {{ workerRow.duration|date_duration }} - {% endif %} + {{ workerRow.status }}