Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
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
钟尚武
physical
Commits
524ee41f
Commit
524ee41f
authored
Oct 16, 2019
by
吴升宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix rand time majia
parent
3104e6bc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
30 deletions
+17
-30
crontab.py
crontab.py
+7
-21
celery_task_router.py
physical/celery_task_router.py
+5
-4
auto_click_per_2h_by_post.py
vest/click/auto_click_per_2h_by_post.py
+1
-1
auto_follow_per_2h_by_post_and_regist.py
vest/follow/auto_follow_per_2h_by_post_and_regist.py
+1
-1
auto_reply_per_2h_to_topic.py
vest/reply/auto_reply_per_2h_to_topic.py
+2
-2
auto_request.py
vest/request/auto_request.py
+1
-1
No files found.
crontab.py
View file @
524ee41f
...
...
@@ -15,21 +15,17 @@ ontime_list = [
"30 10 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_urge2"
,
"0 10 * * 3 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_lunch_app"
,
"30 10 * * 3 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_lunch_app2"
,
"*/5 * * * 1 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_5m_by_followed"
,
#
"*/5 * * * 1 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_5m_by_followed",
"1 */2 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_2h_by_post_and_regist"
,
"0 9 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m get_login_session"
,
"0 0 * * 3 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m get_user_id"
,
# "0 14,18,22 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m principal_online_comment1",
"25 */2 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_reply_per_2h_to_topic"
]
random_time_list
=
[
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_click_per_1d_by_post"
,
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_1d_by_regist"
,
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_1d_by_post"
,
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_reply_per_1d_to_pictorial"
,
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_reply_per_1d_to_topic"
"25 */2 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_reply_per_2h_to_topic"
,
"0 9 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_click_per_1d_by_post"
,
"1 9 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_1d_by_regist"
,
"2 9 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_1d_by_post"
,
"3 9 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_reply_per_1d_to_pictorial"
,
"4 9 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_reply_per_1d_to_topic"
# "* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m answer_reply1",
# "* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m answer_reply2",
# "* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m answer_reply3",
...
...
@@ -48,16 +44,6 @@ random_time_list = [
]
###随机生成10-23的一个数字 代表小时
ss1
=
random
.
choices
(
range
(
10
,
23
),
k
=
100
)
###随机生成1-60的一个数字 表示分钟
ss2
=
random
.
choices
(
range
(
1
,
50
),
k
=
100
)
for
i
in
range
(
len
(
random_time_list
)):
ontime_list
.
append
(
str
(
ss2
[
i
])
+
" "
+
str
(
ss1
[
i
])
+
" "
+
str
(
random_time_list
[
i
]))
data
=
open
(
"/data/log/physical/app/conf.txt"
,
"w"
)
# data = open("abc.txt", "w")
...
...
physical/celery_task_router.py
View file @
524ee41f
...
...
@@ -9,11 +9,12 @@ class CeleryTaskRouter(object):
queue_task_map
=
{
"tapir-alpha"
:
[
'injection.data_sync.tasks.write_to_es'
,
'vest.request.auto_request.click'
,
'vest.request.auto_request.reply'
,
'vest.request.auto_request.follow'
,
'vest.request.auto_request.reply2'
,
'vest.request.auto_request.pictorial_reply'
],
"vest"
:
[
"vest.tasks.follow"
,
]
}
# Map[TaskName, QueueName]
...
...
vest/click/auto_click_per_2h_by_post.py
View file @
524ee41f
...
...
@@ -44,7 +44,7 @@ def batch_handle(auto_click_list):
cookies
=
login
()
if
cookies
is
not
None
:
# click(cookies, topic_id)
click
.
async_apply
(
args
=
(
cookies
,
topic_id
),
eta
=
get_rand_time
())
click
.
async_apply
(
args
=
(
cookies
,
topic_id
),
eta
=
get_rand_time
(
hourup
=
1
))
except
:
pass
...
...
vest/follow/auto_follow_per_2h_by_post_and_regist.py
View file @
524ee41f
...
...
@@ -41,7 +41,7 @@ def batch_handle(auto_follow_list):
cookies
=
login
()
if
cookies
is
not
None
:
# follow(cookies, user_id)
follow
.
async_apply
(
args
=
(
cookies
,
user_id
),
eta
=
get_rand_time
())
follow
.
async_apply
(
args
=
(
cookies
,
user_id
),
eta
=
get_rand_time
(
hourup
=
1
))
except
:
pass
...
...
vest/reply/auto_reply_per_2h_to_topic.py
View file @
524ee41f
...
...
@@ -33,13 +33,13 @@ def batch_handle(topic_id_list):
comment
=
judge_topic_info_get_comment
(
topic_id
)
if
comment
:
# reply(cookies, topic_id, comment)
reply
.
async_apply
(
args
=
(
cookies
,
topic_id
,
comment
),
eta
=
get_rand_time
())
reply
.
async_apply
(
args
=
(
cookies
,
topic_id
,
comment
),
eta
=
get_rand_time
(
hourup
=
1
))
else
:
comment1
,
comment2
=
get_answer_data
()
response
=
reply_answer
(
cookies
,
topic_id
,
comment1
)
cookies
=
login
()
reply_id
=
response
[
"data"
][
"id"
]
reply2
.
async_apply
(
args
=
(
cookies
,
topic_id
,
comment2
,
reply_id
),
eta
=
get_rand_time
())
reply2
.
async_apply
(
args
=
(
cookies
,
topic_id
,
comment2
,
reply_id
),
eta
=
get_rand_time
(
hourup
=
1
))
except
:
logging_exception
()
...
...
vest/request/auto_request.py
View file @
524ee41f
...
...
@@ -435,7 +435,7 @@ def set_reply_to_redis():
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
@shared_task
()
@shared_task
def
reply2
(
cookies_get
,
id
,
content
,
replied_id
):
try
:
post_dict
=
{
...
...
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