diff --git a/transfer_service/db_connector.py b/transfer_service/db_connector.py index c567b9824319d73f931f94ed91aa7ca18be9d5cb..8d528d28be2b798b724aac4da99d64b3312e7a14 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()