Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ems_collector
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZZH
ems_collector
Commits
66ebb5f8
Commit
66ebb5f8
authored
Jun 25, 2026
by
ZZH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt 2026-6-25 15:57
parent
1a2725f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
meter_3rd.py
src/ems_water_grp/meter_3rd.py
+7
-12
No files found.
src/ems_water_grp/meter_3rd.py
View file @
66ebb5f8
...
...
@@ -126,17 +126,12 @@ class Meter3rdForward:
async
def
snapshot_sampler
(
self
):
while
not
self
.
stop_event
.
is_set
():
try
:
# sec_to_min = 60 - (time.time() % 60) + 5
# await asyncio.sleep(sec_to_min)
if
not
self
.
d_last_msg
:
continue
cur_batch
=
dict
(
self
.
d_last_msg
)
self
.
d_last_msg
.
clear
()
for
fid
,
raw_msg
in
cur_batch
.
items
():
if
fid
in
SCADA_FIELDS_MAP
:
await
self
.
parse_and_forward
(
fid
,
raw_msg
)
if
self
.
d_last_msg
:
cur_batch
=
dict
(
self
.
d_last_msg
)
self
.
d_last_msg
.
clear
()
for
fid
,
raw_msg
in
cur_batch
.
items
():
if
fid
in
SCADA_FIELDS_MAP
:
await
self
.
parse_and_forward
(
fid
,
raw_msg
)
await
asyncio
.
sleep
(
1
)
except
Exception
as
e
:
...
...
@@ -216,4 +211,4 @@ if __name__ == '__main__':
try
:
asyncio
.
run
(
main
())
except
KeyboardInterrupt
:
pass
\ No newline at end of file
pass
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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