From 012e17891be286c7b7bcf762200c4c7efd173d53 Mon Sep 17 00:00:00 2001 From: Cristiano Urban Date: Wed, 14 Jul 2021 10:19:01 +0200 Subject: [PATCH] List jobs ordered by 'creation_time' in descending order. Signed-off-by: Cristiano Urban --- transfer_service/db_connector.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/transfer_service/db_connector.py b/transfer_service/db_connector.py index c567b98..8d528d2 100644 --- a/transfer_service/db_connector.py +++ b/transfer_service/db_connector.py @@ -329,7 +329,8 @@ class DbConnector(object): WHERE phase NOT IN ('ABORTED', 'COMPLETED', - 'ERROR'); + 'ERROR') + ORDER BY creation_time DESC; """) result = cursor.fetchall() except Exception as e: @@ -356,7 +357,8 @@ class DbConnector(object): start_time, owner_id FROM job - WHERE phase = %s; + WHERE phase = %s + ORDER BY creation_time DESC; """, (phase,)) else: @@ -368,7 +370,8 @@ class DbConnector(object): end_time, owner_id FROM job - WHERE phase = %s; + WHERE phase = %s + ORDER BY creation_time DESC; """, (phase,)) result = cursor.fetchall() -- GitLab