Commit c4a75db3 authored by 张彦钊's avatar 张彦钊

change test file

parent 679d41d4
......@@ -76,7 +76,7 @@ def tractate_write(device_id,cid):
cursor.execute(sql)
result = cursor.fetchall()
db.close()
cids = [i[0] for i in result]
cids = [str(i[0]) for i in result]
if len(cids) != 0:
r = redis.Redis(host="172.16.40.135", port=5379, password="")
......@@ -84,7 +84,8 @@ def tractate_write(device_id,cid):
if r.exists(key):
value = json.loads(r.get(key)).split(",")
value.extend(cids)
cids = json.dumps(",".join(set(value)))
value = ",".join([str(i) for i in set(value)])
cids = json.dumps(value)
r.set(key, cids)
print("存在")
else:
......
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