Commit f57a61a4 authored by lixiaofang's avatar lixiaofang

dd

parent 2eb8233f
......@@ -30,9 +30,10 @@ def click(card_info):
logging.info("get action:click,card_id:%s,redis_data:%s" % (card_info['card_id'], redis_data))
click_num = redis_data["click"]
if click_num > 10:
if click_num > 12:
logging.info("今天已经消费到最大次数了,不能再消费")
return True, True
return True, False
else:
rpc_invoker = get_rpc_invoker()
try:
......@@ -41,17 +42,15 @@ def click(card_info):
logging.info("get_card_info:%s,create_answer_vote:%s" % (card_info, status))
error = status.get('error', 1)
if error == 0 and click_num <= 10:
if error == 0:
return True, True
elif error == 0 and click_num > 10:
return True, False
else:
send_email_tome(str(card_info) + str(status))
return False, False
return False, True
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False, False
return False, True
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......
......@@ -122,7 +122,7 @@ def comment(card_info):
if comment_num > 12:
logging.info("今天已经消费到最大次数了,不能再消费")
return True, True
return True, False
else:
rpc_invoker = get_rpc_invoker()
......@@ -133,16 +133,14 @@ def comment(card_info):
'comment_content']).unwrap()
logging.info("get_card_info:%s,have_answer_reply:%s" % (card_info, status))
error = status.get('error', 1)
if error == 0 and comment_num <= 11:
if error == 0:
return True, True
elif error == 0 and comment_num > 11:
return True, False
else:
send_email_tome(str(card_info) + str(status))
return False, False
return False, True
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False, False
return False, True
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......
......@@ -27,9 +27,9 @@ def follow(card_info):
logging.info("get action:follow,card_id:%s,redis_data:%s" % (card_info['card_id'], redis_data))
follow_num = redis_data["follow"]
if follow_num > 10:
if follow_num > 11:
logging.info("今天已经消费到最大次数了,不能再消费")
return True, True
return True, False
else:
rpc_invoker = get_rpc_invoker()
......@@ -40,16 +40,14 @@ def follow(card_info):
logging.info("get_card_info:%s,user_add_follow:%s" % (card_info, status))
error = status.get('error', 1)
if error == 0 and follow_num <= 10:
if error == 0:
return True, True
elif error == 0 and follow_num > 10:
return True, False
else:
send_email_tome(str(card_info) + str(status))
return False, False
return False, True
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False, False
return False, True
except:
logging_exception()
logging.error("catch exception,err_msg:%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