From 37724f2d214ffc41f6efb40d2fd76cc96c253520 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Wed, 26 Sep 2018 03:58:53 -0300 Subject: [PATCH] elstat.alerts: use ints instead of bool queries --- elstat/alerts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elstat/alerts.py b/elstat/alerts.py index d934d78..f7b051f 100644 --- a/elstat/alerts.py +++ b/elstat/alerts.py @@ -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()