Skip to content
Snippets Groups Projects
Commit 045d6881 authored by istmxrein's avatar istmxrein
Browse files

fix bug in PowerConsumer

parent efd3437c
No related branches found
No related tags found
No related merge requests found
import functools
import json
import logging
import threading
import traceback
from datetime import datetime
from enum import Enum
......@@ -104,7 +105,7 @@ def send_switch_event(mac: str, state: State):
send_event(routing_key=routing_key, event=event)
class PowerConsumer(object):
class PowerConsumer(threading.Thread):
def __init__(self, queues: List[str], callback: Callable, type: Type, amqp_url: str = utils.BROKER_URL,
arguments: Dict = {"x-stream-offset": "last"}):
......@@ -114,6 +115,7 @@ class PowerConsumer(object):
:param str amqp_url: The AMQP url to connect with
"""
super(PowerConsumer, self).__init__()
self.should_reconnect = False
self.was_consuming = False
......
......@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='pilab',
version='1.2.1',
version='1.2.2',
description='Shared-Libs for the pi-lab microservices',
url='https://code.fbi.h-da.de/api/v4/projects/27896/packages/pypi/pilab',
author='Max Reinheimer',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment