Commit 6f97de38 authored by 张彦钊's avatar 张彦钊

change test file

parent 4d5bef23
...@@ -60,7 +60,7 @@ def write_redis(device_id,cid,card): ...@@ -60,7 +60,7 @@ def write_redis(device_id,cid,card):
tractate_write(device_id, cid) tractate_write(device_id, cid)
def tractate_write(device_id,cid): def tractate_write(device_id,cid):
# try: try:
db = pymysql.connect(host='172.16.40.158', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='eagle') db = pymysql.connect(host='172.16.40.158', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='eagle')
sql = "select b.id from src_mimas_prod_api_tractate_tag a left join src_zhengxing_api_tag b " \ sql = "select b.id from src_mimas_prod_api_tractate_tag a left join src_zhengxing_api_tag b " \
"on a.tag_id = b.id where b.tag_type = '3' and a.tractate_id = {}".format(cid) "on a.tag_id = b.id where b.tag_type = '3' and a.tractate_id = {}".format(cid)
...@@ -89,11 +89,11 @@ def tractate_write(device_id,cid): ...@@ -89,11 +89,11 @@ def tractate_write(device_id,cid):
else: else:
r.set(key, json.dumps(cids)) r.set(key, json.dumps(cids))
r.expire(key, 7*24*60*60) r.expire(key, 7*24*60*60)
# return "tractate good" return "tractate good"
#
# except Exception as e: except Exception as e:
# print("tractate insert redis fail") print("tractate insert redis fail")
# print(e) print(e)
def answer_write(device_id,cid): def answer_write(device_id,cid):
try: try:
...@@ -221,6 +221,6 @@ def diary_write(device_id,cid): ...@@ -221,6 +221,6 @@ def diary_write(device_id,cid):
# ssc.awaitTermination() # ssc.awaitTermination()
# print(tractate_write("hello","10078")) # print(tractate_write("hello","10078"))
print(tractate_write("hello","37975")) print(tractate_write("hello",6))
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