Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KWH40
fml40-reference-implementation
Commits
3c406e5b
Commit
3c406e5b
authored
Apr 27, 2021
by
Jiahang Chen
Browse files
add broker reconnection
parent
a99cab13
Pipeline
#455439
passed with stages
in 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ml/thing.py
View file @
3c406e5b
...
...
@@ -232,9 +232,8 @@ def run_forever(self):
__log
=
"[S3I]: Launch {}"
.
format
(
self
.
name
)
APP_LOGGER
.
info
(
__log
)
self
.
__connect_with_idp
()
self
.
__dir_syn
()
threading
.
Thread
(
target
=
self
.
__json_syn
).
start
()
threading
.
Thread
(
target
=
self
.
__dir_syn
).
start
()
if
self
.
__is_repo
:
threading
.
Thread
(
target
=
self
.
__repo_syn
).
start
()
...
...
@@ -322,7 +321,6 @@ def __on_token(self, token):
:type token: str
"""
self
.
__access_token
=
token
self
.
__connect_with_dir
()
self
.
__connect_with_repo
()
...
...
@@ -407,8 +405,9 @@ def receive():
target
=
self
.
broker
.
receive
,
args
=
(
self
.
__endpoint
,
self
.
__on_broker_callback
),
).
start
()
else
:
self
.
broker
.
update_token
(
self
.
access_token
)
self
.
broker
.
maybe_reconnect
(
self
.
access_token
)
def
__on_broker_callback
(
self
,
ch
,
method
,
properties
,
body
):
"""Parses body (content of a S3I-B message) and delegates the
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment