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
e62c2400
Commit
e62c2400
authored
Mar 31, 2021
by
Jiahang Chen
Browse files
fix applying directory-entry change
parent
0c292f97
Pipeline
#438251
passed with stages
in 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ml/thing.py
View file @
e62c2400
...
...
@@ -265,25 +265,15 @@ def __json_syn(self, freq=0.1):
except
:
continue
def
__dir_syn
(
self
,
freq
=
0.1
):
"""Applies local changes to the directory entry in the cloud.
def
__dir_syn
(
self
):
"""Applies local changes to the directory entry in the cloud
only once
.
:param freq: Frequency of the update.
:type freq: float
"""
while
True
:
# try:
time
.
sleep
(
freq
)
old_dir_json
=
self
.
dir_json
self
.
to_dir_json
()
if
self
.
dir_json
==
old_dir_json
:
continue
else
:
self
.
dir
.
updateThingIDBased
(
thingID
=
self
.
thing_id
,
payload
=
self
.
dir_json
)
# except:
# continue
self
.
to_dir_json
()
if
self
.
dir_json
is
not
None
:
self
.
dir
.
updateThingIDBased
(
thingID
=
self
.
thing_id
,
payload
=
self
.
dir_json
)
def
__repo_syn
(
self
,
freq
=
0.1
):
"""Applies local changes to the repository entry in the cloud.
...
...
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