Skip to content

Commit

Permalink
🔧refactor: sse fine tunning
Browse files Browse the repository at this point in the history
  • Loading branch information
D10S0VSkY-OSS committed Nov 29, 2023
1 parent cfe2a51 commit 35afd63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sld-dashboard/app/home/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ def deploy_stream(task_id):
@login_required
def stream(task_id):
def generate():
pubsub = s.pubsub()
pubsub = s.pubsub(ignore_subscribe_messages=True)
pubsub.subscribe(f'{task_id}')
for message in pubsub.listen():
logging.info(message)
yield f"data: {message['data']}\n\n"
return Response(generate(), mimetype='text/event-stream')

Expand Down
1 change: 1 addition & 0 deletions sld-dashboard/gunicorn-cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

bind = "0.0.0.0:5000"
workers = 10
threads = 100
accesslog = "-"
loglevel = "info"
capture_output = True
Expand Down

0 comments on commit 35afd63

Please sign in to comment.