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
d139cb85
Commit
d139cb85
authored
Jun 06, 2025
by
ZZH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sid iccid add log 2025-6-6 16:30
parent
939ce221
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
sid_iccid_map.py
unify_api/modules/zhiwei_u/service/sid_iccid_map.py
+4
-3
No files found.
unify_api/modules/zhiwei_u/service/sid_iccid_map.py
View file @
d139cb85
...
@@ -9,6 +9,7 @@ import time
...
@@ -9,6 +9,7 @@ import time
from
uuid
import
uuid4
from
uuid
import
uuid4
import
pendulum
import
pendulum
import
asyncio
import
asyncio
import
logging
from
pot_libs.aiomqtt_util.hbmqtt_utils
import
MqttUtil
from
pot_libs.aiomqtt_util.hbmqtt_utils
import
MqttUtil
from
pot_libs.mysql_util.mysql_util
import
MysqlUtil
from
pot_libs.mysql_util.mysql_util
import
MysqlUtil
...
@@ -185,7 +186,7 @@ async def load_iccid(sid):
...
@@ -185,7 +186,7 @@ async def load_iccid(sid):
async
def
update_all
():
async
def
update_all
():
sid_iccids
,
fail_sid
,
tmp
=
[],
set
(),
[]
sid_iccids
,
fail_sid
,
tmp
=
[],
set
(),
[]
sid_total
=
await
load_all_sids
()
sid_total
=
await
load_all_sids
()
print
(
f
"start at {pendulum.now()}, sid total:{len(sid_total)}"
)
logging
.
info
(
f
"start at {pendulum.now()}, sid total:{len(sid_total)}"
)
for
i
,
sid
in
enumerate
(
sid_total
,
start
=
1
):
for
i
,
sid
in
enumerate
(
sid_total
,
start
=
1
):
tmp
.
append
(
sid
)
tmp
.
append
(
sid
)
if
i
%
100
and
i
<
len
(
sid_total
):
if
i
%
100
and
i
<
len
(
sid_total
):
...
@@ -205,8 +206,8 @@ async def update_all():
...
@@ -205,8 +206,8 @@ async def update_all():
if
sid_iccids
:
if
sid_iccids
:
await
batch_insert
(
sid_iccids
)
await
batch_insert
(
sid_iccids
)
print
(
f
"finish task, at {pendulum.now()} success:{len(sid_iccids)}, "
logging
.
info
(
f
"finish task, at {pendulum.now()} success:"
\
f
"
fail:{len(fail_sid)}"
)
f
"{len(sid_iccids)},
fail:{len(fail_sid)}"
)
# if fail_sid:
# if fail_sid:
# sid_iccids, fail_two, tmp = [], set(), []
# sid_iccids, fail_two, tmp = [], set(), []
...
...
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