Commit b03ad5b5 authored by lixiaofang's avatar lixiaofang

add

parent ba9eca6c
......@@ -13,19 +13,17 @@ from get_session import get_comments, get_cookies, click, time_conv, login, repl
@shared_task
def auto_click(id):
def auto_click(pk_list):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT id,user_id FROM topic WHERE id = " + str(
id) + " and user_id in (select user_id from user_extra where is_shadow = 0)")
"SELECT id,user_id FROM topic WHERE id in " + (
pk_list) + " and user_id in (select user_id from user_extra where is_shadow = 0)")
data = cursor.fetchall()
topic_id_list = list(data)
logging.info("Database version : %s " % topic_id_list)
pc.close()
topic_id_list = 919337
exec_count = 0
if topic_id_list:
......@@ -50,8 +48,6 @@ def auto_click(id):
timer = threading.Timer(sleep_time, fun_timer)
timer.start()
sleep_time = random.randint(300, 540)
timer = threading.Timer(10, fun_comment) # 首次启动
timer.start()
......@@ -67,13 +63,13 @@ def auto_click(id):
@shared_task
def auto_reply(id):
def auto_reply(pk_list):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT id,user_id FROM topic WHERE id = " + str(
id) + " and user_id in (select user_id from user_extra where is_shadow = 0)")
"SELECT id,user_id FROM topic WHERE id in " + (
pk_list) + " and user_id in (select user_id from user_extra where is_shadow = 0)")
data = cursor.fetchall()
topic_id_list = list(data)
logging.info("Database version : %s " % topic_id_list)
......@@ -113,4 +109,3 @@ def auto_reply(id):
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
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