elstat.alerts: use ints instead of bool queries

This commit is contained in:
Luna Mendes 2018-09-26 03:58:53 -03:00
parent 867d7d1e69
commit 37724f2d21

View file

@ -43,7 +43,7 @@ class DiscordAlert:
# find the last work that had a success
cur.execute(f"""
SELECT timestamp FROM {worker.name}
WHERE timestamp < ? AND status = true
WHERE timestamp < ? AND status = 1
ORDER BY timestamp DESC
LIMIT 1
""", (status['timestamp'], ))
@ -54,7 +54,7 @@ class DiscordAlert:
# now we fetch all the downtime after that ts_success
cur.execute(f"""
SELECT COUNT(*) FROM {worker.name}
WHERE timestamp > ? AND status = false
WHERE timestamp > ? AND status = 0
""", (ts_success,))
row = cur.fetchone()