Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_strategy_cvr
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
rank
gm_strategy_cvr
Commits
d49d0e4b
Commit
d49d0e4b
authored
Jul 23, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scan redis
parent
81986785
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
+34
-3
main_portrait.py
src/main_portrait.py
+34
-3
No files found.
src/main_portrait.py
View file @
d49d0e4b
import
datetime
from
utils.cache
import
redis_client2
from
utils.portrait
import
user_portrait_tag3_get_candidate_unread_list
from
utils.portrait
import
user_portrait_tag3_get_candidate_unread_list
def
user_portrait_scan_info
():
try
:
round
=
0
all_count
=
0
# keys = "doris:user_portrait:tag3:device_id:*"
keys
=
"doris:user_portrait:tag3:candidate:diary:device_id:*"
cur
,
results
=
redis_client2
.
scan
(
0
,
keys
,
3000
)
while
cur
!=
0
:
round
+=
1
print
(
"round: "
+
str
(
round
))
cur
,
results
=
redis_client2
.
scan
(
cur
,
keys
,
3000
)
for
key
in
results
:
key
=
str
(
key
,
"utf-8"
)
device_id
=
key
.
split
(
":"
)[
-
1
]
print
(
device_id
)
print
(
user_portrait_tag3_get_candidate_unread_list
(
device_id
,
"diary"
)[:
10
])
all_count
+=
1
# user_portrait_get_empty_candidates(device_id)
print
(
"all count: "
+
str
(
all_count
))
print
(
"scan done "
+
str
(
datetime
.
datetime
.
now
()))
except
Exception
as
e
:
print
(
e
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
device_id
=
"androidid_a25a1129c0b38f7b"
# device_id = "androidid_a25a1129c0b38f7b"
res
=
user_portrait_tag3_get_candidate_unread_list
(
device_id
,
"diary"
)
# res = user_portrait_tag3_get_candidate_unread_list(device_id, "diary")
print
(
res
)
# print(res)
user_portrait_scan_info
()
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