From 6bcaa6453e837eaa2ad94b5fdd2ba68724a80d80 Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Thu, 20 May 2021 19:00:11 +0200 Subject: [PATCH] Update hibp_last_check on succesful HIBP check Accidentally got rid of this during some refactor --- cron.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cron.py b/cron.py index c714fb75..b3ba8348 100644 --- a/cron.py +++ b/cron.py @@ -806,6 +806,7 @@ async def _hibp_check(api_key, queue): ) return + alias.hibp_last_check = arrow.utcnow() db.session.add(alias) db.session.commit() @@ -840,7 +841,7 @@ async def check_hibp(): or_(Alias.hibp_last_check.is_(None), Alias.hibp_last_check < max_date) ) .filter(Alias.enabled) - .order_by(Alias.id) + .order_by(Alias.hibp_last_check.asc()) .all() ): await queue.put(alias.id)