status check: also check for recent fetches and refreshes
This commit is contained in:
parent
94d146627e
commit
f09c606fe6
|
@ -20,10 +20,13 @@ def api_status_check():
|
||||||
return ('Redis bad', 500)
|
return ('Redis bad', 500)
|
||||||
|
|
||||||
if db.session.execute(db.text("""
|
if db.session.execute(db.text("""
|
||||||
SELECT count(*) FROM accounts
|
SELECT 1 FROM accounts
|
||||||
WHERE last_delete > now() - '10 minutes'::INTERVAL;
|
WHERE last_delete > now() - '60 minutes'::INTERVAL
|
||||||
""")).fetchone() < 1:
|
OR last_fetch > now() - '60 minutes'::INTERVAL
|
||||||
return ('Deletes stalled', 500)
|
OR last_refresh > now() - '60 minutes'::INTERVAL
|
||||||
|
LIMIT 1;
|
||||||
|
""")).fetchone() is None:
|
||||||
|
return ('Celery stalled', 500)
|
||||||
|
|
||||||
return 'OK'
|
return 'OK'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue