diff --git a/dump2shushu.py b/dump2shushu.py index 89b1936..5d97d0c 100644 --- a/dump2shushu.py +++ b/dump2shushu.py @@ -51,7 +51,11 @@ def get_from_redis(): all = [] for i in range(1, 1000): 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: log.error(f"get data failed!", exc_info=True) for one in all: