From 713083e989659d3768f70be195ca3d7327c2214a Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 2 May 2023 20:16:29 +0200 Subject: fbin-scanner: Rollback session on exception The session needs to be rolled back after an error before we're able to start a new transaction. --- fbin-scanner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fbin-scanner.py b/fbin-scanner.py index 3dac420..0c343d9 100644 --- a/fbin-scanner.py +++ b/fbin-scanner.py @@ -143,6 +143,7 @@ def poll_loop(): # On errors, log the exception and retry. Don't update 'now' so that we will retry with the same files. # This tends to happen eg. when we process a file but it's been deleted when we try to update it. logger.exception('Error while processing files') + db.session.rollback() time.sleep(60) -- cgit v1.2.3