Commit 7e4c7121 authored by 段英荣's avatar 段英荣

Merge branch 'redis_reply' into 'master'

add

See merge request !490
parents 672f78f6 2b36bf79
......@@ -10,13 +10,16 @@ def reply_comment1():
redis_key1 = "cybertron:set_reply_id:one"
redis_client = set_reply_to_redis()
have_reply1 = redis_client.get(redis_key1)
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
if have_reply1 == None:
pass
else:
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -10,13 +10,16 @@ def reply_comment2():
redis_key1 = "cybertron:set_reply_id:two"
redis_client = set_reply_to_redis()
have_reply1 = redis_client.get(redis_key1)
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
if have_reply1 == None:
pass
else:
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -10,13 +10,16 @@ def reply_comment3():
redis_key1 = "cybertron:set_reply_id:three"
redis_client = set_reply_to_redis()
have_reply1 = redis_client.get(redis_key1)
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
if have_reply1 == None:
pass
else:
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -10,13 +10,16 @@ def reply_comment5():
redis_key1 = "cybertron:set_reply_id:five"
redis_client = set_reply_to_redis()
have_reply1 = redis_client.get(redis_key1)
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
if have_reply1 == None:
pass
else:
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -10,13 +10,16 @@ def reply_comment7():
redis_key1 = "cybertron:set_reply_id:seven"
redis_client = set_reply_to_redis()
have_reply1 = redis_client.get(redis_key1)
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
if have_reply1 == None:
pass
else:
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
except:
logging_exception()
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