Clean up debugging code
This commit is contained in:
parent
b917fed126
commit
ccaaf6be3f
2 changed files with 21 additions and 17 deletions
|
|
@ -1,8 +1,14 @@
|
|||
import asyncio
|
||||
#asyncio.get_event_loop().set_debug(True) # uncomment for asycio debugging mode
|
||||
|
||||
import logging
|
||||
|
||||
# general (asyncio) logging level
|
||||
#logging.basicConfig(level=logging.DEBUG)
|
||||
#logging.basicConfig(level=logging.INFO)
|
||||
logging.basicConfig(level=logging.WARNING)
|
||||
|
||||
# yaboli logger level
|
||||
logger = logging.getLogger(__name__)
|
||||
#logger.setLevel(logging.DEBUG)
|
||||
logger.setLevel(logging.INFO)
|
||||
|
|
@ -14,4 +20,11 @@ from .database import *
|
|||
from .room import *
|
||||
from .utils import *
|
||||
|
||||
__all__ = connection.__all__ + room.__all__ + controller.__all__ + utils.__all__
|
||||
__all__ = (
|
||||
bot.__all__ +
|
||||
connection.__all__ +
|
||||
controller.__all__ +
|
||||
database.__all__ +
|
||||
room.__all__ +
|
||||
utils.__all__
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
import asyncio
|
||||
asyncio.get_event_loop().set_debug(True)
|
||||
|
||||
import json
|
||||
import websockets
|
||||
import logging
|
||||
import socket
|
||||
#from websockets import ConnectionClosed
|
||||
import websockets
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
__all__ = ["Connection"]
|
||||
|
||||
|
||||
|
|
@ -35,6 +31,9 @@ class Connection:
|
|||
|
||||
Attempt to connect to a room.
|
||||
Returns the task listening for packets, or None if the attempt failed.
|
||||
|
||||
max_tries - maximum number of reconnect attempts before stopping
|
||||
delay - time (in seconds) between reconnect attempts
|
||||
"""
|
||||
|
||||
logger.debug(f"Attempting to connect, max_tries={max_tries}")
|
||||
|
|
@ -178,15 +177,7 @@ class Connection:
|
|||
self._spawned_tasks.add(task)
|
||||
|
||||
# only keep running tasks
|
||||
#tasks = set()
|
||||
#for task in self._spawned_tasks:
|
||||
#if not task.done():
|
||||
#logger.debug(f"Keeping task: {task}")
|
||||
#tasks.add(task)
|
||||
#else:
|
||||
#logger.debug(f"Deleting task: {task}")
|
||||
#self._spawned_tasks = tasks
|
||||
self._spawned_tasks = {task for task in self._spawned_tasks if not task.done()} # TODO: Reenable
|
||||
self._spawned_tasks = {task for task in self._spawned_tasks if not task.done()}
|
||||
|
||||
def _wait_for_response(self, pid):
|
||||
future = asyncio.Future()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue