Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
U
unify_api2
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
chaonan
unify_api2
Commits
03b50bcb
Commit
03b50bcb
authored
Dec 15, 2023
by
ZZH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove opendata test 2023-12-15
parent
11b7900a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
20 deletions
+34
-20
open_data.py
unify_api/modules/shidianu/views/open_data.py
+34
-20
No files found.
unify_api/modules/shidianu/views/open_data.py
View file @
03b50bcb
...
@@ -177,23 +177,37 @@ async def post_home_page_alarm_stats(req, body: HomeAlarmStatsReq) -> \
...
@@ -177,23 +177,37 @@ async def post_home_page_alarm_stats(req, body: HomeAlarmStatsReq) -> \
power_quality
=
sr
.
power_quality
power_quality
=
sr
.
power_quality
)
)
# async def main():
async
def
main
():
# import logging
import
logging
# logger = logging.getLogger("opendata.log")
cid
=
223
# logger.setLevel(logging.INFO)
# start = "2023-11-30 08:10:59"
# handler = logging.FileHandler("/home/ubuntu/data/code/log/opendata.log", encoding='UTF-8')
# end = "2023-11-30 09:22:59"
# handler.setLevel(logging.INFO)
storeys
=
await
storey_by_cid
(
cid
)
# formatter = logging.Formatter(
storey_ids
=
[
item
[
"storey_id"
]
for
item
in
storeys
]
# "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
while
True
:
# handler.setFormatter(formatter)
rlt
=
await
new_list_alarm_service
(
cid
,
storey_ids
,
0
,
5
,
None
,
None
,
# logger.addHandler(handler)
[
1
,
2
],
None
,
4
)
#
print
(
rlt
.
total
,
rlt
.
rows
)
# console = logging.StreamHandler()
logging
.
info
(
pendulum
.
now
(),
rlt
.
total
,
len
(
rlt
.
rows
),
rlt
.
rows
)
# console.setLevel(logging.INFO)
await
asyncio
.
sleep
(
300
)
# logger.addHandler(console)
#
# logger.info("start opendata tt")
if
__name__
==
'__main__'
:
#
import
asyncio
# cid = 223
# # start = "2023-11-30 08:10:59"
asyncio
.
get_event_loop
()
.
run_until_complete
(
main
())
# # end = "2023-11-30 09:22:59"
# storeys = await storey_by_cid(cid)
# storey_ids = [item["storey_id"] for item in storeys]
# while True:
# rlt = await new_list_alarm_service(cid, storey_ids, 0, 5, None, None,
# [1, 2], None, 4)
# logger.info(f"{str(pendulum.now().format('YYYY-MM-DD HH:mm:ss'))}")
# logger.info(f"\n{len(rlt.rows)}, {rlt.rows}")
# await asyncio.sleep(300)
#
#
# if __name__ == '__main__':
# import asyncio
#
# asyncio.get_event_loop().run_until_complete(main())
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