add rudimentary check for recent last_delete (#400)

This commit is contained in:
codl 2021-03-13 01:46:27 +01:00
parent 44632934a7
commit 94d146627e
1 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,12 @@ def api_status_check():
except Exception:
return ('Redis bad', 500)
if db.session.execute(db.text("""
SELECT count(*) FROM accounts
WHERE last_delete > now() - '10 minutes'::INTERVAL;
""")).fetchone() < 1:
return ('Deletes stalled', 500)
return 'OK'