Skip to content

Commit

Permalink
[worker] End of compability with Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine committed Apr 21, 2021
1 parent aaba127 commit c8e1a78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions opencti-worker/src/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def terminate(self) -> None:
ctypes.pythonapi.PyThreadState_SetAsyncExc(thread_id, 0)
logging.info("Unable to kill the thread")

def nack_message(self, channel: BlockingChannel, delivery_tag: str) -> None:
def nack_message(self, channel: BlockingChannel, delivery_tag: int) -> None:
if channel.is_open:
logging.info("%s", f"Message (delivery_tag={delivery_tag}) rejected")
channel.basic_nack(delivery_tag)
Expand All @@ -81,7 +81,7 @@ def nack_message(self, channel: BlockingChannel, delivery_tag: str) -> None:
f"Message (delivery_tag={delivery_tag}) NOT rejected (channel closed)",
)

def ack_message(self, channel: BlockingChannel, delivery_tag: str) -> None:
def ack_message(self, channel: BlockingChannel, delivery_tag: int) -> None:
if channel.is_open:
logging.info("%s", f"Message (delivery_tag={delivery_tag}) acknowledged")
channel.basic_ack(delivery_tag)
Expand Down Expand Up @@ -231,8 +231,8 @@ def run(self) -> None:
class Worker:
def __init__(self) -> None:
self.logs_all_queue: str = "logs_all"
self.consumer_threads: dict[str, Any] = {}
self.logger_threads: dict[str, Any] = {}
self.consumer_threads: Dict[str, Any] = {}
self.logger_threads: Dict[str, Any] = {}

# Get configuration
config_file_path = os.path.join(
Expand Down

0 comments on commit c8e1a78

Please sign in to comment.