mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Don't crash the discussions task on timeouts and other mundane server errors
This commit is contained in:
parent
482b217c1f
commit
e0059dd1e7
|
@ -12,7 +12,7 @@ from src.api.util import default_message
|
|||
from src.discord.queue import QueueEntry, messagequeue
|
||||
from src.i18n import langs
|
||||
from src.misc import prepare_settings
|
||||
from src.exceptions import WikiError
|
||||
from src.exceptions import WikiError, WikiServerError
|
||||
from src.config import settings
|
||||
from src.queue_handler import dbmanager
|
||||
from src.argparser import command_line_args
|
||||
|
@ -82,6 +82,9 @@ class Discussions:
|
|||
except asyncio.TimeoutError:
|
||||
logger.debug("Timeout on reading JSON of discussion post feed.")
|
||||
return
|
||||
except WikiServerError:
|
||||
logger.exception("Wiki server error.")
|
||||
return
|
||||
if isinstance(discussion_feed, list) and any(discussion_feed) is False:
|
||||
return
|
||||
if wiki.discussion_id is None: # new wiki, just get the last post to not spam the channel
|
||||
|
@ -110,6 +113,7 @@ class Discussions:
|
|||
except aiohttp.ClientResponseError: # Fandom can be funny sometimes... See #30
|
||||
comment_pages = None
|
||||
except:
|
||||
comment_pages = None
|
||||
if command_line_args.debug:
|
||||
logger.exception("Exception on Feeds article comment request")
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue