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
2964351c
Commit
2964351c
authored
Sep 02, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add print
parent
aede0c97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
config.py
config.py
+4
-0
diaryUpdateOnlineOffline.py
diaryUpdateOnlineOffline.py
+4
-3
No files found.
config.py
View file @
2964351c
...
...
@@ -24,6 +24,10 @@ LOCAL_DIRCTORY = "/Users/mac/utils/"
# 线上日记队列域名
QUEUE_ONLINE_HOST
=
'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
import
pymysql
db
=
pymysql
.
connect
(
host
=
'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
,
port
=
3306
,
user
=
'doris'
,
passwd
=
'o5gbA27hXHHm'
,
db
=
'doris_prod'
)
# 本地日记队列域名
LOCAL_HOST
=
'rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com'
...
...
diaryUpdateOnlineOffline.py
View file @
2964351c
...
...
@@ -38,6 +38,8 @@ def get_video_id(cache_video_id):
return
cache_video_id
else
:
video_id
=
df
[
0
]
.
values
.
tolist
()
print
(
"videoid"
)
print
(
video_id
[:
2
])
return
video_id
...
...
@@ -218,7 +220,7 @@ def get_queue(device_id, city_id,queue_name):
print
(
'db'
)
db
=
pymysql
.
connect
(
host
=
QUEUE_ONLINE_HOST
,
port
=
3306
,
user
=
'doris'
,
passwd
=
'o5gbA27hXHHm'
,
db
=
'doris_prod'
)
print
(
db
)
print
(
10
)
else
:
db
=
pymysql
.
connect
(
host
=
LOCAL_HOST
,
port
=
3306
,
user
=
'work'
,
passwd
=
'workwork'
,
db
=
'doris_test'
)
...
...
@@ -257,7 +259,6 @@ def pipe_line(queue_name, queue_arg, device_id,total_video_id):
def
user_update
(
device_id
,
city_id
,
queue_name
,
data_set_cid
,
total_video_id
):
print
(
0
)
queue_list
=
get_queue
(
device_id
,
city_id
,
queue_name
)
if
queue_list
:
queue_predict
=
list
(
set
(
queue_list
)
&
set
(
data_set_cid
))
...
...
@@ -280,7 +281,7 @@ def user_update(device_id, city_id, queue_name,data_set_cid,total_video_id):
def
multi_proecess_update
(
device_id
,
city_id
,
data_set_cid
,
total_video_id
):
queue_name_list
=
[
"native_queue"
,
"nearby_queue"
,
"nation_queue"
,
"megacity_queue"
]
pool
=
Pool
(
4
)
pool
=
Pool
(
1
)
for
queue_name
in
queue_name_list
:
pool
.
apply_async
(
user_update
,
(
device_id
,
city_id
,
queue_name
,
data_set_cid
,
total_video_id
,))
pool
.
close
()
...
...
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