diff --git a/routes/api.py b/routes/api.py index f6fa1da..fa7c707 100644 --- a/routes/api.py +++ b/routes/api.py @@ -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'