Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shared-libs
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pi-Lab
shared-libs
Commits
045d6881
Commit
045d6881
authored
2 years ago
by
istmxrein
Browse files
Options
Downloads
Patches
Plain Diff
fix bug in PowerConsumer
parent
efd3437c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pilab/events/power.py
+3
-1
3 additions, 1 deletion
pilab/events/power.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
4 additions
and
2 deletions
pilab/events/power.py
+
3
−
1
View file @
045d6881
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
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
045d6881
...
...
@@ -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
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment