From 84089f8a4084812f938e743725d8b6396d61f2ea Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 11 Mar 2019 02:02:47 +0000 Subject: [PATCH] refresh_account: increment backoff if something crashes this is kind of a hotfix for the thing with pleroma returning bad error messages crashing mastodon.py. but it's good practice anyway --- tasks.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks.py b/tasks.py index 789dffa..c4d0006 100644 --- a/tasks.py +++ b/tasks.py @@ -316,6 +316,11 @@ def refresh_account(account_id): make_dormant(account) if sentry: sentry.captureException() + except Exception as e: + db.session.rollback() + account.backoff() + db.session.commit() + raise e finally: db.session.commit()