ahhh
This commit is contained in:
parent
99ccdbef46
commit
2038e84654
|
@ -18,17 +18,16 @@ import redis
|
|||
pool = redis.ConnectionPool(host='localhost', port=6379, db=0)
|
||||
r = redis.Redis(connection_pool=pool)
|
||||
|
||||
pubsub = r.pubsub()
|
||||
pubsub.subscribe('console')
|
||||
|
||||
def generate_output():
|
||||
pubsub = r.pubsub()
|
||||
pubsub.subscribe('console')
|
||||
try :
|
||||
for message in pubsub.listen():
|
||||
if message['type'] == 'message':
|
||||
print(message)
|
||||
yield f"data: {message['data'].decode()}\n\n"
|
||||
except :
|
||||
print("ya eu une erreur sad")
|
||||
except Exception as e:
|
||||
print(f"ya eu une erreur sad {e}")
|
||||
|
||||
# the end
|
||||
|
||||
|
|
Loading…
Reference in New Issue