Various fixes based on recent crash

This commit is contained in:
Frisk 2020-08-14 23:38:26 +02:00
parent 57c2b54b74
commit 71c2d4fd8c
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
2 changed files with 3 additions and 3 deletions

View file

@ -320,7 +320,7 @@ async def discussion_handler():
try: try:
while True: while True:
fetch_all = db_cursor.execute( fetch_all = db_cursor.execute(
'SELECT wiki, wikiid, postid FROM rcgcdw WHERE wikiid IS NOT NULL') 'SELECT wiki, wikiid, rcid, postid FROM rcgcdw WHERE wikiid IS NOT NULL')
for db_wiki in fetch_all.fetchall(): for db_wiki in fetch_all.fetchall():
header = settings["header"] header = settings["header"]
header["Accept"] = "application/hal+json" header["Accept"] = "application/hal+json"
@ -441,7 +441,7 @@ async def main_loop():
await asyncio.gather(main_tasks["wiki_scanner"], main_tasks["discussion_handler"], main_tasks["message_sender"]) await asyncio.gather(main_tasks["wiki_scanner"], main_tasks["discussion_handler"], main_tasks["message_sender"])
except KeyboardInterrupt: except KeyboardInterrupt:
shutdown(loop) shutdown(loop)
except asyncio.exceptions.CancelledError: except asyncio.CancelledError:
return return
asyncio.run(main_loop(), debug=False) asyncio.run(main_loop(), debug=False)

View file

@ -113,7 +113,7 @@ async def generic_msg_sender_exception_logger(exception: str, title: str, **kwar
message = DiscordMessage("embed", "bot/exception", [None], wiki=None) message = DiscordMessage("embed", "bot/exception", [None], wiki=None)
message["description"] = exception message["description"] = exception
message["title"] = title message["title"] = title
for key, value in kwargs: for key, value in kwargs.items():
message.add_field(key, value) message.add_field(key, value)
message.finish_embed() message.finish_embed()
await send_to_discord_webhook_monitoring(message) await send_to_discord_webhook_monitoring(message)