From e181bd1ba482ce7b3433fb45e6a1aae7d49cceda Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 3 Oct 2023 00:30:20 +0200 Subject: [PATCH] je devienne fou --- Flask/app.py | 13 +++++++------ tempo.py | 2 -- 2 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 tempo.py diff --git a/Flask/app.py b/Flask/app.py index cfe656b..f2df2f0 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -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 diff --git a/tempo.py b/tempo.py deleted file mode 100644 index 62e310a..0000000 --- a/tempo.py +++ /dev/null @@ -1,2 +0,0 @@ -while 1: - print("a")