Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
vest
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
2
Merge Requests
2
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
vest
Commits
0eea5e38
Commit
0eea5e38
authored
Dec 25, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修日志
parent
31770047
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2 additions
and
21 deletions
+2
-21
auto_click.py
click/views/auto_click.py
+0
-1
auto_comment.py
comment/views/auto_comment.py
+1
-3
auto_follow.py
follow/views/auto_follow.py
+0
-2
consum.py
moment/views/consum.py
+0
-1
irrigation.py
moment/views/irrigation.py
+1
-2
process_time.py
moment/views/process_time.py
+0
-12
No files found.
click/views/auto_click.py
View file @
0eea5e38
...
@@ -83,7 +83,6 @@ def auto_click_user(card_info, after_day=False):
...
@@ -83,7 +83,6 @@ def auto_click_user(card_info, after_day=False):
else
:
# 代表还有push好的时间没有下发完成 需要继续使用这些
else
:
# 代表还有push好的时间没有下发完成 需要继续使用这些
logging
.
info
(
"get--------click--------------card_info:
%
s"
%
card_info
)
current_user_id
=
card_info
[
"current_user_id"
]
current_user_id
=
card_info
[
"current_user_id"
]
card_info
[
"all_follow_id"
]
.
remove
(
current_user_id
)
card_info
[
"all_follow_id"
]
.
remove
(
current_user_id
)
current_push_time
=
card_info
[
'current_push_time'
]
current_push_time
=
card_info
[
'current_push_time'
]
...
...
comment/views/auto_comment.py
View file @
0eea5e38
...
@@ -95,10 +95,8 @@ def auto_comment_user(card_info, after_day=False):
...
@@ -95,10 +95,8 @@ def auto_comment_user(card_info, after_day=False):
break
break
repeat_time
+=
1
repeat_time
+=
1
logging
.
info
(
"get have_get_after__time:
%
s"
%
card_info
)
logging
.
info
(
"get
comment_
have_get_after__time:
%
s"
%
card_info
)
else
:
# 代表还有push好的时间没有下发完成 需要继续使用这些
else
:
# 代表还有push好的时间没有下发完成 需要继续使用这些
logging
.
info
(
"get-------comment---------------card_info:
%
s"
%
card_info
)
current_user_id
=
card_info
[
"current_user_id"
]
current_user_id
=
card_info
[
"current_user_id"
]
card_info
[
"all_follow_id"
]
.
remove
(
current_user_id
)
card_info
[
"all_follow_id"
]
.
remove
(
current_user_id
)
current_push_time
=
card_info
[
'current_push_time'
]
current_push_time
=
card_info
[
'current_push_time'
]
...
...
follow/views/auto_follow.py
View file @
0eea5e38
...
@@ -101,8 +101,6 @@ def auto_follow_user(card_info, after_day=False):
...
@@ -101,8 +101,6 @@ def auto_follow_user(card_info, after_day=False):
save_data_to_kafka
(
card_info
)
# 存储数据
save_data_to_kafka
(
card_info
)
# 存储数据
logging
.
info
(
"get-----follow----card_info:
%
s"
%
card_info
)
except
:
except
:
logging_exception
()
logging_exception
()
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
moment/views/consum.py
View file @
0eea5e38
...
@@ -41,7 +41,6 @@ def kafka_consum(topic_name=None):
...
@@ -41,7 +41,6 @@ def kafka_consum(topic_name=None):
nowtime
=
datetime
.
datetime
.
now
()
nowtime
=
datetime
.
datetime
.
now
()
push_time_date
=
datetime
.
datetime
.
strptime
(
current_push_time
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
push_time_date
=
datetime
.
datetime
.
strptime
(
current_push_time
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
if
push_time_date
<=
nowtime
:
# push_time已经到时间了 需要去下发
if
push_time_date
<=
nowtime
:
# push_time已经到时间了 需要去下发
logging
.
info
(
"get push_time_date:
%
s"
%
push_time_date
)
# 判断如果当前的push_time 和当前的创建时间一样 需要给push_time下发真的push时间
# 判断如果当前的push_time 和当前的创建时间一样 需要给push_time下发真的push时间
if
current_push_time
==
create_time
:
if
current_push_time
==
create_time
:
if
card_info
[
'action_type'
]
==
"comment"
:
if
card_info
[
'action_type'
]
==
"comment"
:
...
...
moment/views/irrigation.py
View file @
0eea5e38
...
@@ -18,7 +18,7 @@ def vest_irrigation(card_id=0, card_type=None, card_user_id=None, create_time=""
...
@@ -18,7 +18,7 @@ def vest_irrigation(card_id=0, card_type=None, card_user_id=None, create_time=""
producer
=
KafkaProducer
(
bootstrap_servers
=
[
settings
.
KAFKA_BROKER_LIST
])
producer
=
KafkaProducer
(
bootstrap_servers
=
[
settings
.
KAFKA_BROKER_LIST
])
logging
.
info
(
"------------------------"
)
logging
.
info
(
"------------------------
-----------------------
"
)
topic
=
settings
.
KAFKA_TOPIC_NAME
topic
=
settings
.
KAFKA_TOPIC_NAME
tag_list
=
[
"瘦脸针kyc"
,
"双眼皮kyc"
,
"水光针kyc"
,
"玻尿酸kyc"
,
"吸脂kyc"
,
"祛痘kyc"
,
"鼻综合kyc"
,
"光子嫩肤kyc"
,
"没有想法kyc"
,
tag_list
=
[
"瘦脸针kyc"
,
"双眼皮kyc"
,
"水光针kyc"
,
"玻尿酸kyc"
,
"吸脂kyc"
,
"祛痘kyc"
,
"鼻综合kyc"
,
"光子嫩肤kyc"
,
"没有想法kyc"
,
...
@@ -73,7 +73,6 @@ def vest_irrigation(card_id=0, card_type=None, card_user_id=None, create_time=""
...
@@ -73,7 +73,6 @@ def vest_irrigation(card_id=0, card_type=None, card_user_id=None, create_time=""
producer
.
send
(
topic
,
json
.
dumps
(
click_msg_dict
)
.
encode
())
producer
.
send
(
topic
,
json
.
dumps
(
click_msg_dict
)
.
encode
())
producer
.
close
()
producer
.
close
()
logging
.
info
(
"------------------------"
)
except
:
except
:
logging_exception
()
logging_exception
()
...
...
moment/views/process_time.py
View file @
0eea5e38
...
@@ -162,13 +162,11 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
...
@@ -162,13 +162,11 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
##根据转换后的分钟数进行比较
##根据转换后的分钟数进行比较
##转化成分数后进行一层一层的比较
##转化成分数后进行一层一层的比较
if
num_days
==
0
:
if
num_days
==
0
:
logging
.
info
(
"-------------当天----------------------------"
)
get_time
=
randomDate
(
create_time
=
createt
,
action_type
=
action_type
)
get_time
=
randomDate
(
create_time
=
createt
,
action_type
=
action_type
)
time_region
=
0
time_region
=
0
return
get_time
,
time_region
return
get_time
,
time_region
elif
num_days
>=
1
and
num_days
<=
6
:
elif
num_days
>=
1
and
num_days
<=
6
:
logging
.
info
(
"-------------1-6天的----------------------------"
)
get_time
=
get_one_six_days_random_time
(
content_level
=
content_level
,
num_days
=
num_days
,
get_time
=
get_one_six_days_random_time
(
content_level
=
content_level
,
num_days
=
num_days
,
action_type
=
action_type
,
action_type
=
action_type
,
...
@@ -177,8 +175,6 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
...
@@ -177,8 +175,6 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
return
get_time
,
time_region
return
get_time
,
time_region
elif
num_days
>
6
and
num_days
<=
365
:
elif
num_days
>
6
and
num_days
<=
365
:
logging
.
info
(
"-------------6天后的---------------------------"
)
get_time
=
get_ten_last_days_random_time
(
num_days
=
num_days
,
content_level
=
content_level
,
get_time
=
get_ten_last_days_random_time
(
num_days
=
num_days
,
content_level
=
content_level
,
content_day_need_add_one_day
=
content_day_need_add_one_day
)
content_day_need_add_one_day
=
content_day_need_add_one_day
)
time_region
=
2
time_region
=
2
...
@@ -186,7 +182,6 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
...
@@ -186,7 +182,6 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
else
:
else
:
##需要删掉kafka的数据不再进行下发
##需要删掉kafka的数据不再进行下发
logging
.
info
(
"-------------所有下发结束---------------------------"
)
return
[],
3
return
[],
3
except
:
except
:
...
@@ -217,8 +212,6 @@ def get_click_follow_time_by_create_time(create_time="", content_level=0, action
...
@@ -217,8 +212,6 @@ def get_click_follow_time_by_create_time(create_time="", content_level=0, action
if
num_days
==
0
:
if
num_days
==
0
:
logging
.
info
(
"-------------当天----------------------------"
)
logging
.
info
(
"-------------当天----------------------------"
)
get_time
=
randomDate
(
create_time
=
createt
,
action_type
=
action_type
)
get_time
=
randomDate
(
create_time
=
createt
,
action_type
=
action_type
)
logging
.
info
(
"拿到当天的时间 get get_time:
%
s"
%
get_time
)
return
get_time
,
0
return
get_time
,
0
elif
num_days
==
1
:
elif
num_days
==
1
:
...
@@ -226,14 +219,12 @@ def get_click_follow_time_by_create_time(create_time="", content_level=0, action
...
@@ -226,14 +219,12 @@ def get_click_follow_time_by_create_time(create_time="", content_level=0, action
content_level
=
content_level
,
content_level
=
content_level
,
content_day_need_add_one_day
=
content_day_need_add_one_day
)
content_day_need_add_one_day
=
content_day_need_add_one_day
)
logging
.
info
(
"1天的 get get_time:
%
s"
%
get_time
)
return
get_time
,
1
return
get_time
,
1
elif
num_days
>
1
and
num_days
<=
15
:
elif
num_days
>
1
and
num_days
<=
15
:
get_time
=
get_one_six_days_random_time
(
num_days
=
num_days
,
action_type
=
action_type
,
get_time
=
get_one_six_days_random_time
(
num_days
=
num_days
,
action_type
=
action_type
,
content_level
=
content_level
,
content_level
=
content_level
,
content_day_need_add_one_day
=
content_day_need_add_one_day
)
content_day_need_add_one_day
=
content_day_need_add_one_day
)
logging
.
info
(
"2-15天后的的时间 get get_time:
%
s"
%
get_time
)
return
get_time
,
2
return
get_time
,
2
...
@@ -242,12 +233,9 @@ def get_click_follow_time_by_create_time(create_time="", content_level=0, action
...
@@ -242,12 +233,9 @@ def get_click_follow_time_by_create_time(create_time="", content_level=0, action
get_time
=
get_ten_last_days_random_time
(
num_days
=
num_days
,
action_type
=
action_type
,
get_time
=
get_ten_last_days_random_time
(
num_days
=
num_days
,
action_type
=
action_type
,
content_level
=
content_level
,
content_level
=
content_level
,
content_day_need_add_one_day
=
content_day_need_add_one_day
)
content_day_need_add_one_day
=
content_day_need_add_one_day
)
logging
.
info
(
"拿到15天后的时间 get get_time:
%
s"
%
get_time
)
return
get_time
,
4
return
get_time
,
4
else
:
else
:
logging
.
info
(
"-------------所有下发结束---------------------------"
)
return
[],
3
return
[],
3
except
:
except
:
...
...
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