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

fix auto reply

parent 12cfba41
...@@ -38,7 +38,7 @@ def get_data(numtime1, numtime2): ...@@ -38,7 +38,7 @@ def get_data(numtime1, numtime2):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT pictorial_id ,count(*) as count FROM community_pictorial_topic WHERE is_online=1 and (create_time >= '%s' and create_time < '%s') group by pictorial_id " % ( "SELECT pictorial_id FROM community_pictorial_topic WHERE is_online=1 and (create_time >= '%s' and create_time < '%s') group by pictorial_id " % (
numtime1, numtime2)) numtime1, numtime2))
res = cursor.fetchall() res = cursor.fetchall()
...@@ -87,6 +87,9 @@ def auto_reply_per_1d_to_pictorial(): ...@@ -87,6 +87,9 @@ def auto_reply_per_1d_to_pictorial():
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
logging.info('auto_click_per_2h_by_post: len %s' % len(pictorial_id_list))
print('auto_click_per_2h_by_post: len %s' % len(pictorial_id_list))
total = len(pictorial_id_list) total = len(pictorial_id_list)
limit = (total + 10) // 10 limit = (total + 10) // 10
for start in range(0, total, limit): for start in range(0, total, limit):
......
...@@ -14,7 +14,7 @@ def get_data(numtime, numtime2, content_level_low, content_level_top): ...@@ -14,7 +14,7 @@ def get_data(numtime, numtime2, content_level_low, content_level_top):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time >= '%s' and create_time <= '%s' )" "SELECT id FROM topic WHERE is_online=1 and (create_time >= '%s' and create_time <= '%s' )"
"and content_level>= %s and content_level<= %s" % ( "and content_level>= %s and content_level<= %s" % (
numtime2, numtime, str(content_level_low), str(content_level_top))) numtime2, numtime, str(content_level_low), str(content_level_top)))
res = cursor.fetchall() res = cursor.fetchall()
...@@ -78,6 +78,9 @@ def auto_reply_per_1d_to_topic(): ...@@ -78,6 +78,9 @@ def auto_reply_per_1d_to_topic():
logging_exception() logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
logging.info('auto_click_per_2h_by_post: len %s' % len(topic_id_list))
print('auto_click_per_2h_by_post: len %s' % len(topic_id_list))
total = len(topic_id_list) total = len(topic_id_list)
limit = (total + 10) // 10 limit = (total + 10) // 10
for start in range(0, total, limit): for start in range(0, total, limit):
......
...@@ -50,6 +50,10 @@ def auto_reply_per_2h_to_topic(): ...@@ -50,6 +50,10 @@ def auto_reply_per_2h_to_topic():
logging_exception() logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
logging.info('auto_click_per_2h_by_post: len %s' % len(topic_id_list))
print('auto_click_per_2h_by_post: len %s' % len(topic_id_list))
total = len(topic_id_list) total = len(topic_id_list)
limit = (total + 10) // 10 limit = (total + 10) // 10
for start in range(0, total, limit): for start in range(0, total, limit):
......
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