Commit e12d0366 authored by 段英荣's avatar 段英荣

Merge branch 'update_vest' into 'master'

Update vest

See merge request alpha/physical!415
parents cba8d966 e750ae2e
import pymysql
import traceback
import logging
import json
from vest.request.auto_request import host, user, db, passwd
from libs.cache import redis_client
from libs.error import logging_exception
......@@ -38,7 +39,7 @@ def auto_user_id():
for i in data:
file.write(str(i[0]))
file.write("\n")
redis_client.set("get_user_id_data", data)
redis_client.set("get_user_id_data", json.dumps(data))
except:
logging_exception()
......
......@@ -3,7 +3,9 @@ import pymysql
import random
import traceback
import logging
import json
import datetime
from libs.cache import redis_client
from vest.request.auto_request import get_offline_comment
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
......@@ -60,14 +62,14 @@ def vest_click_reply():
logging.info("get majia data11111111111")
now = datetime.datetime.now()
yes_time = now - datetime.timedelta(minutes=5)
user_data = open("/srv/apps/physical/vest/data/user_id.txt", "r")
data = json.loads(redis_client.get("get_user_id_data"))
user_list = []
for i in user_data.readlines():
user_list.append(i)
for i in data:
user_list.append(i[0])
topic_id = get_data(yes_time, now)
if topic_id:
for id in topic_id:
rand_num = random.randint(1, 3)
rand_num = random.randint(0, 4)
for i in range(rand_num):
num = random.randint(0, len(user_list) - 1)
user_id = user_list[num]
......
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