This commit is contained in:
tursom 2024-03-01 15:23:09 +08:00
parent 9962cd3d4e
commit 2cca794367

View File

@ -77,10 +77,8 @@ def flush_files():
def subscribe_redis():
p = r.pubsub()
p.psubscribe(**{f"__keyspace@0__:{room_list_key}": room_changed_handler})
while True:
message = p.get_message()
if message:
print(message)
for message in p.listen():
pass
# noinspection PyUnusedLocal
@ -128,7 +126,7 @@ class JsonlLogger(blivedm.BaseHandler):
os.makedirs("logs", exist_ok=True)
log_files[client.room_id] = open(f"logs/{client.room_id}.jsonl", "a", encoding="utf-8")
log_files[client.room_id].write(f"{json.dumps(message, separators=(',', ':'))}\n")
log_files[client.room_id].write(f"{json.dumps(message, separators=(',', ':'), ensure_ascii=False)}\n")
jsonl_logger = JsonlLogger()