From 34465584879d0ed6ba9825c2e9b9c0f492fdee98 Mon Sep 17 00:00:00 2001 From: Jacob Henry Date: Wed, 28 Nov 2018 19:52:13 -0500 Subject: [PATCH] Added a debug function that counts all current tasks --- client_wrapper.py | 2 ++ main.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client_wrapper.py b/client_wrapper.py index 5b92d79..13af720 100644 --- a/client_wrapper.py +++ b/client_wrapper.py @@ -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 diff --git a/main.py b/main.py index 3c52010..00c8775 100644 --- a/main.py +++ b/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)