From 3f74ab903d955008c183f0f7c1fd3bcf5875e8c2 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Thu, 21 Oct 2021 11:22:01 +0200 Subject: main: Order by messageid instead of time Some messages (like pastes) occur at exactly the same time and are inserted into the database with the same timestamp. quarg will print these messages in a seemingly random order. Make sure to use the messageid (which should increase monotonically) to order messages instead. --- quarg/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quarg/main.py b/quarg/main.py index 5ba6e3d..9fde869 100644 --- a/quarg/main.py +++ b/quarg/main.py @@ -102,9 +102,9 @@ def prepare_query(session, predicates, args): for predicate in predicates: query = query.filter(predicate) - order = Backlog.time.asc() + order = Backlog.messageid.asc() if args.order == 'desc': - order = Backlog.time.desc() + order = Backlog.messageid.desc() query = query.order_by(order) -- cgit v1.2.3-2-gb3c3