From 329e6e8cd8c4b01879fb78057dba957036c3bfad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 7 Nov 2022 13:01:27 +0100 Subject: limit 1 on borrow query to prevent copying all borrows to python from db --- gather.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gather.py b/gather.py index d4beec6..2992ae0 100755 --- a/gather.py +++ b/gather.py @@ -73,7 +73,7 @@ try: acsm_id = force_acsm_id force_acsm_id = 0 else: - borrow = session.scalars(select(Borrow).order_by(Borrow.id.desc())).first() + borrow = session.scalars(select(Borrow).order_by(Borrow.id.desc()).limit(1)).first() acsm_id = starting_acsm_id if borrow is None: logger.info(f"oooh, it looks like this is a fresh start, db contains no borrows. I'll start with hardcoded acsm id {starting_acsm_id}") -- cgit v1.2.3