Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
ca42d68d
Commit
ca42d68d
authored
Oct 19, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
第三版的画像,离线更新存储改为redis,之前为gmkv
parent
1605975a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
dist_update_user_portrait_service.py
eda/smart_rank/dist_update_user_portrait_service.py
+5
-4
No files found.
eda/smart_rank/dist_update_user_portrait_service.py
View file @
ca42d68d
...
...
@@ -118,12 +118,13 @@ def get_user_service_portrait(cl_id, all_word_tags, all_tag_tag_type, all_3tag_2
gm_kv_cli
.
set
(
cl_id_portrait_key
,
tag_id_list_json
)
gm_kv_cli
.
expire
(
cl_id_portrait_key
,
time
=
30
*
24
*
60
*
60
)
# 写redis
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:ReDis!GmTx*0aN9@172.16.40.173:6379'
)
cl_id_portrait_key2
=
"user:service_portrait_tags2:cl_id:"
+
str
(
cl_id
)
tag_id_list_json2
=
json
.
dumps
(
gmkv_tag_score2_sum_dict
)
gm_kv_cli
.
set
(
cl_id_portrait_key2
,
tag_id_list_json2
)
gm_kv_cli
.
expire
(
cl_id_portrait_key2
,
time
=
30
*
24
*
60
*
60
)
redis_client
.
hmset
(
cl_id_portrait_key2
,
gmkv_tag_score2_sum_dict
)
redis_client
.
expire
(
cl_id_portrait_key2
,
time
=
30
*
24
*
60
*
60
)
# 写tidb,
redis
同步
# 写tidb,
gmkv
同步
stat_date
=
datetime
.
datetime
.
today
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
replace_sql
=
"""replace into user_service_portrait_tags (stat_date, cl_id, tag_list) values("{stat_date}","{cl_id}","{tag_list}")"""
\
.
format
(
stat_date
=
stat_date
,
cl_id
=
cl_id
,
tag_list
=
gmkv_tag_score_sum
)
...
...
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