je devienne fou

This commit is contained in:
piair 2023-10-03 00:30:20 +02:00
parent 8991e4f4c8
commit e181bd1ba4
2 changed files with 7 additions and 8 deletions

View File

@ -20,12 +20,13 @@ pubsub = redis_client.pubsub()
pubsub.subscribe('console')
def generate_output():
try:
for message in pubsub.listen():
if message['type'] == 'message':
yield f"data: {message['data'].decode()}\n\n"
except redis.exceptions.ConnectionError as e:
print(f"Error connecting to Redis: {e}")
while 1 :
try:
for message in pubsub.listen():
if message['type'] == 'message':
yield f"data: {message['data'].decode()}\n\n"
except redis.exceptions.ConnectionError as e:
print(f"Error connecting to Redis: {e}")
# the end

View File

@ -1,2 +0,0 @@
while 1:
print("a")