forked from piair/MsRewards-Reborn
je devienne fou
This commit is contained in:
parent
8991e4f4c8
commit
e181bd1ba4
13
Flask/app.py
13
Flask/app.py
@ -20,12 +20,13 @@ pubsub = redis_client.pubsub()
|
|||||||
pubsub.subscribe('console')
|
pubsub.subscribe('console')
|
||||||
|
|
||||||
def generate_output():
|
def generate_output():
|
||||||
try:
|
while 1 :
|
||||||
for message in pubsub.listen():
|
try:
|
||||||
if message['type'] == 'message':
|
for message in pubsub.listen():
|
||||||
yield f"data: {message['data'].decode()}\n\n"
|
if message['type'] == 'message':
|
||||||
except redis.exceptions.ConnectionError as e:
|
yield f"data: {message['data'].decode()}\n\n"
|
||||||
print(f"Error connecting to Redis: {e}")
|
except redis.exceptions.ConnectionError as e:
|
||||||
|
print(f"Error connecting to Redis: {e}")
|
||||||
|
|
||||||
# the end
|
# the end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user