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
This commit is contained in:
codl 2019-03-11 02:02:47 +00:00
parent 78c84ed92c
commit 84089f8a40
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 5 additions and 0 deletions

View File

@ -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()