Small stylistic change in SQL query + another debug statement

This commit is contained in:
Frisk 2021-03-20 13:55:56 +01:00
parent a2f1d54f39
commit 5a6345a3e0
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
2 changed files with 2 additions and 1 deletions

View file

@ -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:

View file

@ -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: