diff options
author | 2020-10-27 02:11:30 +0000 | |
---|---|---|
committer | 2020-10-27 02:11:30 +0000 | |
commit | 8c7eab5966089a64dcf0899c4f5c28462f745cdb (patch) | |
tree | 60ca78e11783759c118d492c0a82d2772687eb30 /pydis_site/apps/api/models | |
parent | Clean up SQL query (diff) |
Constant was never used :man_facepalming:
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r-- | pydis_site/apps/api/models/bot/metricity.py | 7 |
1 files changed, 5 insertions, 2 deletions
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 |