Commit aa264a78 authored by 吴升宇's avatar 吴升宇

Merge branch 'wsy3' into 'master'

fix random time

See merge request alpha/physical!552
parents 437e375f 2cf5666b
...@@ -4,7 +4,7 @@ ontime_list = [ ...@@ -4,7 +4,7 @@ ontime_list = [
"0 9 * * * source /srv/envs/physical/bin/activate && python /data/log/physical/app/crontab.py", "0 9 * * * source /srv/envs/physical/bin/activate && python /data/log/physical/app/crontab.py",
"10 9 * * * source /srv/envs/physical/bin/activate && python /data/log/physical/app/crontabs.py", "10 9 * * * source /srv/envs/physical/bin/activate && python /data/log/physical/app/crontabs.py",
"0 9 * * * sh /data/log/cybertron/app/statistics_query.sh > /data/log/cybertron/app/statistics_query.log", "0 9 * * * sh /data/log/cybertron/app/statistics_query.sh > /data/log/cybertron/app/statistics_query.log",
"54 */2 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_click_per_2h_by_post", "54 */1 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_click_per_2h_by_post",
# "*/5 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m true_click_one", # "*/5 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m true_click_one",
# "02,12,22,32,42,52 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es-m true_click_two", # "02,12,22,32,42,52 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es-m true_click_two",
# "00,10,20,30,40,50 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m true_click_three", # "00,10,20,30,40,50 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m true_click_three",
...@@ -16,11 +16,11 @@ ontime_list = [ ...@@ -16,11 +16,11 @@ ontime_list = [
"0 10 * * 3 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_lunch_app", "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", "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", "1 */1 * * * 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 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 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", # "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", "25 */1 * * * 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", "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", "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", "2 9 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_1d_by_post",
......
...@@ -42,7 +42,8 @@ def batch_handle(auto_click_list): ...@@ -42,7 +42,8 @@ def batch_handle(auto_click_list):
try: try:
cookies = login() cookies = login()
if cookies is not None: if cookies is not None:
click.apply_async(args=(cookies, topic_id), eta=get_rand_time()) time = get_rand_time()
click.apply_async(args=(cookies, topic_id), eta=time)
# click(cookies, topic_id) # click(cookies, topic_id)
except: except:
pass pass
......
...@@ -44,7 +44,8 @@ def batch_handle(auto_click_list): ...@@ -44,7 +44,8 @@ def batch_handle(auto_click_list):
cookies = login() cookies = login()
if cookies is not None: if cookies is not None:
# click(cookies, topic_id) # click(cookies, topic_id)
click.apply_async(args=(cookies, topic_id), eta=get_rand_time(hourup=1)) time = get_rand_time(hourup=0)
click.apply_async(args=(cookies, topic_id), eta=time)
except: except:
pass pass
...@@ -54,7 +55,7 @@ def auto_click_per_2h_by_post(): ...@@ -54,7 +55,7 @@ def auto_click_per_2h_by_post():
auto_click_list = [] auto_click_list = []
try: try:
# 发帖2小时内:[1-3]个点赞 # 发帖2小时内:[1-3]个点赞
numtime1, numtime2 = time_conv_hour(0, 2) numtime1, numtime2 = time_conv_hour(0, 1)
topic_ids = get_commnet_id(numtime2, numtime1, content_level_low=0, content_level_top=6) topic_ids = get_commnet_id(numtime2, numtime1, content_level_low=0, content_level_top=6)
for topic_id in topic_ids: for topic_id in topic_ids:
click_num = random.randint(1, 3) click_num = random.randint(1, 3)
......
...@@ -30,7 +30,8 @@ def batch_handle(auto_follow_list): ...@@ -30,7 +30,8 @@ def batch_handle(auto_follow_list):
cookies = login() cookies = login()
if cookies is not None: if cookies is not None:
# follow(cookies, user_id) # follow(cookies, user_id)
follow.apply_async(args=(cookies, user_id), eta=get_rand_time()) time = get_rand_time()
follow.apply_async(args=(cookies, user_id), eta=time)
except: except:
pass pass
......
...@@ -29,7 +29,8 @@ def batch_handle(auto_follow_list): ...@@ -29,7 +29,8 @@ def batch_handle(auto_follow_list):
cookies = login() cookies = login()
if cookies is not None: if cookies is not None:
# follow(cookies, user_id) # follow(cookies, user_id)
follow.apply_async(args=(cookies, user_id), eta=get_rand_time()) time = get_rand_time()
follow.apply_async(args=(cookies, user_id), eta=time)
except: except:
pass pass
......
...@@ -41,7 +41,8 @@ def batch_handle(auto_follow_list): ...@@ -41,7 +41,8 @@ def batch_handle(auto_follow_list):
cookies = login() cookies = login()
if cookies is not None: if cookies is not None:
# follow(cookies, user_id) # follow(cookies, user_id)
follow.apply_async(args=(cookies, user_id), eta=get_rand_time(hourup=1)) time = get_rand_time(hourup=0)
follow.apply_async(args=(cookies, user_id), eta=time)
except: except:
pass pass
...@@ -52,7 +53,7 @@ def auto_follow_per_2h_by_post_and_regist(): ...@@ -52,7 +53,7 @@ def auto_follow_per_2h_by_post_and_regist():
auto_follow_list = [] auto_follow_list = []
try: try:
# 发帖,注册后2小时内:[1-3]个粉丝 # 发帖,注册后2小时内:[1-3]个粉丝
numtime1, numtime2 = time_conv_hour(0, 2) numtime1, numtime2 = time_conv_hour(0, 1)
user_ids = get_commnet_id(numtime2, numtime1, content_level_low=0, content_level_top=6) user_ids = get_commnet_id(numtime2, numtime1, content_level_low=0, content_level_top=6)
for user_id in user_ids: for user_id in user_ids:
follow_num = random.randint(1, 3) follow_num = random.randint(1, 3)
......
...@@ -57,7 +57,8 @@ def batch_handle(pictorial_id_list): ...@@ -57,7 +57,8 @@ def batch_handle(pictorial_id_list):
if cookies is not None: if cookies is not None:
comment = judge_pictorial_info_get_comment(pictorial_id) comment = judge_pictorial_info_get_comment(pictorial_id)
# pictorial_reply(cookies, pictorial_id, comment) # pictorial_reply(cookies, pictorial_id, comment)
pictorial_reply.apply_async(args=(cookies, pictorial_id, comment), eta=get_rand_time()) time = get_rand_time()
pictorial_reply.apply_async(args=(cookies, pictorial_id, comment), eta=time)
except: except:
pass pass
......
...@@ -35,14 +35,16 @@ def batch_handle(topic_id_list): ...@@ -35,14 +35,16 @@ def batch_handle(topic_id_list):
comment = judge_topic_info_get_comment(topic_id) comment = judge_topic_info_get_comment(topic_id)
if comment: if comment:
# reply(cookies, topic_id, comment) # reply(cookies, topic_id, comment)
reply.apply_async(args=(cookies, topic_id, comment), eta=get_rand_time()) time = get_rand_time()
reply.apply_async(args=(cookies, topic_id, comment), eta=time)
else: else:
comment1, comment2 = get_answer_data() comment1, comment2 = get_answer_data()
response = reply_answer(cookies, topic_id, comment1) response = reply_answer(cookies, topic_id, comment1)
response = json.loads(response) response = json.loads(response)
cookies = login() cookies = login()
reply_id = response["data"]["id"] reply_id = response["data"]["id"]
reply2.apply_async(args=(cookies, topic_id, comment2, reply_id), eta=get_rand_time()) time = get_rand_time()
reply2.apply_async(args=(cookies, topic_id, comment2, reply_id), eta=time)
......
...@@ -34,14 +34,16 @@ def batch_handle(topic_id_list): ...@@ -34,14 +34,16 @@ def batch_handle(topic_id_list):
comment = judge_topic_info_get_comment(topic_id) comment = judge_topic_info_get_comment(topic_id)
if comment: if comment:
# reply(cookies, topic_id, comment) # reply(cookies, topic_id, comment)
reply.apply_async(args=(cookies, topic_id, comment), eta=get_rand_time(hourup=1)) time = get_rand_time(hourup=0)
reply.apply_async(args=(cookies, topic_id, comment), eta=time)
else: else:
comment1, comment2 = get_answer_data() comment1, comment2 = get_answer_data()
response = reply_answer(cookies, topic_id, comment1) response = reply_answer(cookies, topic_id, comment1)
response = json.loads(response) response = json.loads(response)
cookies = login() cookies = login()
reply_id = response["data"]["id"] reply_id = response["data"]["id"]
reply2.apply_async(args=(cookies, topic_id, comment2, reply_id), eta=get_rand_time(hourup=1)) time = get_rand_time(hourup=0)
reply2.apply_async(args=(cookies, topic_id, comment2, reply_id), eta=time)
except: except:
logging_exception() logging_exception()
...@@ -51,7 +53,7 @@ def batch_handle(topic_id_list): ...@@ -51,7 +53,7 @@ def batch_handle(topic_id_list):
def auto_reply_per_2h_to_topic(): def auto_reply_per_2h_to_topic():
topic_id_list = [] topic_id_list = []
try: try:
numtime1, numtime2 = time_conv_hour(0, 2) numtime1, numtime2 = time_conv_hour(0, 1)
topic_ids = get_data(numtime1, numtime2) topic_ids = get_data(numtime1, numtime2)
for topic_id in topic_ids: for topic_id in topic_ids:
random_num = random.randint(1, 2) random_num = random.randint(1, 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment