Added a debug function that counts all current tasks
This commit is contained in:
parent
1850ee8718
commit
3446558487
|
|
@ -5,6 +5,7 @@ from typing import List, Any, AsyncGenerator, Coroutine, TypeVar
|
|||
from slackclient import SlackClient # Obvious
|
||||
|
||||
import channel_util
|
||||
import sys
|
||||
import slack_util
|
||||
|
||||
# Read the API token
|
||||
|
|
@ -62,6 +63,7 @@ class ClientWrapper(object):
|
|||
Asynchronous tasks that eternally reads and responds to messages.
|
||||
"""
|
||||
async for t in self.spool_tasks():
|
||||
sys.stdout.flush()
|
||||
if DEBUG_MODE:
|
||||
await t
|
||||
|
||||
|
|
|
|||
2
main.py
2
main.py
|
|
@ -54,7 +54,7 @@ def main() -> None:
|
|||
wrap.add_passive(periodicals.RemindJobs())
|
||||
|
||||
event_loop = asyncio.get_event_loop()
|
||||
event_loop.set_debug(True)
|
||||
event_loop.set_debug(client_wrapper.DEBUG_MODE)
|
||||
message_handling = wrap.respond_messages()
|
||||
passive_handling = wrap.run_passives()
|
||||
both = asyncio.gather(message_handling, passive_handling)
|
||||
|
|
|
|||
Loading…
Reference in New Issue