Commit e3e43b11 authored by lixiaofang's avatar lixiaofang

add

parent 6d806be0
This diff is collapsed.
...@@ -63,7 +63,6 @@ if __name__ == "__main__": ...@@ -63,7 +63,6 @@ if __name__ == "__main__":
{"id": reply_id, "reply_user_id": reply_user_id, "answer": comment2, "topic_id": i[1]}) {"id": reply_id, "reply_user_id": reply_user_id, "answer": comment2, "topic_id": i[1]})
redis_client = set_reply_to_redis() redis_client = set_reply_to_redis()
logging.info("get nowwwwwwwww:%s" % minute) redis_client.hset(redis_key1, str(minute), json.dumps(reply_data_comment))
redis_client.hset(redis_key1, str(minute), reply_data_comment)
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
...@@ -9,14 +9,10 @@ from auto_request import set_reply_to_redis, reply2, login ...@@ -9,14 +9,10 @@ from auto_request import set_reply_to_redis, reply2, login
if __name__ == "__main__": if __name__ == "__main__":
try: try:
logging.info("get-------------------------------get ")
now = datetime.datetime.now().minute now = datetime.datetime.now().minute
redis_key1 = "cybertron:set_reply_id:one" redis_key1 = "cybertron:set_reply_id:one"
redis_client = set_reply_to_redis() redis_client = set_reply_to_redis()
logging.info("get now -----munite:%s" % now)
have_reply1 = redis_client.hget(redis_key1, str(now - 5)) have_reply1 = redis_client.hget(redis_key1, str(now - 5))
if have_reply1:
logging.info("get now -----have_reply1:%s" % have_reply1)
result = json.loads(str(have_reply1, encoding="utf-8")) result = json.loads(str(have_reply1, encoding="utf-8"))
if result: if result:
for item in result: for item in result:
......
...@@ -9,9 +9,7 @@ if __name__ == "__main__": ...@@ -9,9 +9,7 @@ if __name__ == "__main__":
try: try:
redis_key1 = "cybertron:set_reply_id:three" redis_key1 = "cybertron:set_reply_id:three"
redis_client = set_reply_to_redis() redis_client = set_reply_to_redis()
have_reply1 = redis_client.get(redis_key1) have_reply1 = redis_client.get(redis_key1)
result = json.loads(str(have_reply1, encoding="utf-8")) result = json.loads(str(have_reply1, encoding="utf-8"))
if result: if result:
......
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