From 8c7eab5966089a64dcf0899c4f5c28462f745cdb Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Tue, 27 Oct 2020 02:11:30 +0000 Subject: Constant was never used :man_facepalming: --- pydis_site/apps/api/models/bot/metricity.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/api/models/bot/metricity.py b/pydis_site/apps/api/models/bot/metricity.py index 93d0df71..81d6e788 100644 --- a/pydis_site/apps/api/models/bot/metricity.py +++ b/pydis_site/apps/api/models/bot/metricity.py @@ -49,12 +49,15 @@ class Metricity: def total_message_blocks(self, user_id: str) -> int: """Query number of 10 minute blocks the user has been active during.""" self.cursor.execute( - """ + f""" SELECT COUNT(*) FROM ( SELECT - to_timestamp(floor((extract('epoch' from created_at) / 600 )) * 600) + to_timestamp( + floor((extract('epoch' from created_at) / {BLOCK_INTERVAL} )) + * {BLOCK_INTERVAL} + ) AT TIME ZONE 'UTC' AS interval FROM messages WHERE -- cgit v1.2.3