mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Some coroutine descriptions
This commit is contained in:
parent
eb6e03a365
commit
f8293b6255
|
@ -63,6 +63,8 @@ def generate_targets(wiki_url: str) -> defaultdict:
|
||||||
|
|
||||||
|
|
||||||
async def wiki_scanner():
|
async def wiki_scanner():
|
||||||
|
"""Wiki scanner is spawned as a task which purpose is to continuously run over wikis in the DB, fetching recent changes
|
||||||
|
to add messages based on the changes to message queue later handled by message_sender coroutine."""
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
calc_delay = calculate_delay()
|
calc_delay = calculate_delay()
|
||||||
|
@ -126,6 +128,7 @@ async def wiki_scanner():
|
||||||
if command_line_args.debug:
|
if command_line_args.debug:
|
||||||
raise # reraise the issue
|
raise # reraise the issue
|
||||||
else:
|
else:
|
||||||
|
logger.exception("Exception on RC formatter")
|
||||||
await formatter_exception_logger(db_wiki["wiki"], change, traceback.format_exc())
|
await formatter_exception_logger(db_wiki["wiki"], change, traceback.format_exc())
|
||||||
if recent_changes:
|
if recent_changes:
|
||||||
DBHandler.add(db_wiki["wiki"], change["rcid"])
|
DBHandler.add(db_wiki["wiki"], change["rcid"])
|
||||||
|
@ -136,6 +139,7 @@ async def wiki_scanner():
|
||||||
|
|
||||||
|
|
||||||
async def message_sender():
|
async def message_sender():
|
||||||
|
"""message_sender is a coroutine responsible for handling Discord messages and their sending to Discord"""
|
||||||
while True:
|
while True:
|
||||||
await messagequeue.resend_msgs()
|
await messagequeue.resend_msgs()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue