From 5a6345a3e000015d8cc7ef8b04a842b5e89545c7 Mon Sep 17 00:00:00 2001 From: Frisk Date: Sat, 20 Mar 2021 13:55:56 +0100 Subject: [PATCH] Small stylistic change in SQL query + another debug statement --- src/bot.py | 2 +- src/database.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bot.py b/src/bot.py index 2b26a43..e4e6eb0 100644 --- a/src/bot.py +++ b/src/bot.py @@ -151,7 +151,7 @@ class RcQueue: full = set() async with db.pool().acquire() as connection: async with connection.transaction(): - async for db_wiki in connection.cursor('SELECT DISTINCT wiki, row_number() over (ORDER BY webhook) AS ROWID, webhook, lang, display, rcid FROM rcgcdw WHERE rcid != -1 OR rcid IS NULL order by webhook'): + async for db_wiki in connection.cursor('SELECT DISTINCT wiki, row_number() OVER (ORDER BY webhook) AS rowid, webhook, lang, display, rcid FROM rcgcdw WHERE rcid != -1 OR rcid IS NULL ORDER BY webhook'): domain = get_domain(db_wiki["wiki"]) try: if db_wiki["wiki"] not in all_wikis: diff --git a/src/database.py b/src/database.py index 86cb293..190ec4f 100644 --- a/src/database.py +++ b/src/database.py @@ -19,6 +19,7 @@ class db_connection: logger.debug("Database connection established! Connection: {}".format(self.connection)) async def shutdown_connection(self): + logger.debug("Shutting down database connection...") await self.connection.close() def pool(self) -> asyncpg.Pool: