mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] Display messages in real-time in the api
This commit is contained in:
parent
25e1ed86d7
commit
282ae99cab
1 changed files with 7 additions and 1 deletions
|
@ -8,10 +8,12 @@ import binascii
|
|||
import argparse
|
||||
from json import dumps as json_encode
|
||||
|
||||
from bottle import run, request, response, Bottle, HTTPResponse
|
||||
from gevent import sleep
|
||||
from gevent.queue import Queue
|
||||
from geventwebsocket import WebSocketError
|
||||
|
||||
from bottle import run, request, response, Bottle, HTTPResponse
|
||||
|
||||
from moulinette.core import MoulinetteError, clean_session
|
||||
from moulinette.interfaces import (BaseActionsMapParser, BaseInterface)
|
||||
|
||||
|
@ -340,6 +342,10 @@ class _ActionsMapPlugin(object):
|
|||
# Put the message as a 2-tuple in the queue
|
||||
queue.put_nowait((style, message))
|
||||
|
||||
# Put the current greenlet to sleep for 0 second in order to
|
||||
# populate the new message in the queue
|
||||
sleep(0)
|
||||
|
||||
|
||||
# HTTP Responses -------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue