From 8f1b94307c8034301d3a25caf65825889a6e5980 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sat, 27 Jun 2020 19:14:54 +0200 Subject: [PATCH] python 3.5 --- distbot/bot/action_worker.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/distbot/bot/action_worker.py b/distbot/bot/action_worker.py index 0d96371..fcf1bc6 100644 --- a/distbot/bot/action_worker.py +++ b/distbot/bot/action_worker.py @@ -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', -- 2.39.2