mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
I don't really know what I'm doing
This commit is contained in:
parent
dd449a9fc5
commit
a24b2cee39
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
import asyncio
|
||||
import logging
|
||||
import time
|
||||
import traceback
|
||||
from collections import OrderedDict
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from functools import cache
|
||||
|
@ -119,8 +120,9 @@ class Domain:
|
|||
if command_line_args.debug:
|
||||
logger.exception("IRC scheduler task for domain {} failed!".format(self.name))
|
||||
else:
|
||||
await self.send_exception_to_monitoring(e)
|
||||
self.failures += 1
|
||||
traceback.print_exc()
|
||||
await self.send_exception_to_monitoring(e)
|
||||
if self.failures > 2:
|
||||
raise asyncio.exceptions.CancelledError
|
||||
|
||||
|
@ -163,7 +165,7 @@ class Domain:
|
|||
async def send_exception_to_monitoring(self, ex: Exception):
|
||||
discord_message = DiscordMessage("embed", "generic", [""])
|
||||
discord_message["title"] = "Domain scheduler exception for {} (recovered)".format(self.name)
|
||||
discord_message["content"] = str(ex)[0:1995]
|
||||
discord_message["content"] = traceback.format_exc(ex)[0:1995]
|
||||
discord_message.add_field("Failure count", str(self.failures))
|
||||
discord_message.finish_embed_message()
|
||||
header = settings["header"]
|
||||
|
|
|
@ -47,7 +47,7 @@ class DomainManager:
|
|||
logger.info(self.domains)
|
||||
for name, domain in self.domains.items():
|
||||
logger.info("{name} - Status: {status}, exception: {exception}".format(name=name, status=domain.task.done(),
|
||||
exception=domain.task.get_stack()))
|
||||
exception=domain.task.print_stack()))
|
||||
else:
|
||||
raise ValueError("Unknown pub/sub command! Payload: {}".format(payload))
|
||||
|
||||
|
|
Loading…
Reference in a new issue