]> git.aero2k.de Git - urlbot-v3.git/commitdiff
python 3.5
authorThorsten <mail@aero2k.de>
Sat, 27 Jun 2020 17:14:54 +0000 (19:14 +0200)
committerThorsten <mail@aero2k.de>
Sat, 27 Jun 2020 17:14:54 +0000 (19:14 +0200)
distbot/bot/action_worker.py

index 0d96371c5c61e0209445019f9f8274866d41be70..fcf1bc64421176bc95acef8655dffdd8e985d78a 100644 (file)
@@ -3,9 +3,7 @@ import json
 import logging
 import threading
 import time
-from typing import Optional
 
-from pika.adapters import AsyncioConnection
 from pika.channel import Channel
 
 from distbot.common.action import Action, send_action
@@ -42,8 +40,8 @@ class ActionWorker(object):
 
     def __init__(self, bot, queue_name):
         self._bot = bot
-        self._connection: Optional[AsyncioConnection] = None
-        self._channel: Optional[Channel] = None
+        self._connection = None
+        self._channel = None
         self._queue_name = queue_name
         self._consumer_tag = None
 
@@ -74,8 +72,7 @@ class ActionWorker(object):
         self._consumer_tag = self._channel.basic_consume(
             self.on_message, self._queue_name
         )
-        logging.info(
-            f"Setup consumer for actions on ch {self._channel} on con {self._connection} with tag {self._consumer_tag}")
+        logging.info("Setup consumer for actions on ch %s on con %s with tag %s", self._channel, self._connection, self._consumer_tag)
 
     def on_message(self, ch, method, properties, body):
         logging.info('Received message # %s from %s: %s',