接口写入redis,另一个脚本将REDIS数据写入数数
This commit is contained in:
parent
4e95799888
commit
28df8ea6a6
@ -51,7 +51,11 @@ def get_from_redis():
|
|||||||
all = []
|
all = []
|
||||||
for i in range(1, 1000):
|
for i in range(1, 1000):
|
||||||
try:
|
try:
|
||||||
all.append(json.loads(my_redis.brpop(redis_key)))
|
one_line = my_redis.lpop(redis_key)
|
||||||
|
if one_line:
|
||||||
|
all.append(json.dumps(one_line))
|
||||||
|
else:
|
||||||
|
continue
|
||||||
except Exception:
|
except Exception:
|
||||||
log.error(f"get data failed!", exc_info=True)
|
log.error(f"get data failed!", exc_info=True)
|
||||||
for one in all:
|
for one in all:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user