fix: baseline WS client + gunicorn gevent, bump 1.0.23
Deploy loadtest / validate (push) Waiting to run
Deploy loadtest / validate (push) Waiting to run
This commit is contained in:
+2
-3
@@ -6,7 +6,7 @@ from flask_sock import Sock
|
||||
app = Flask(__name__)
|
||||
sock = Sock(app)
|
||||
|
||||
VERSION = '1.0.22'
|
||||
VERSION = '1.0.23'
|
||||
|
||||
|
||||
@app.route('/')
|
||||
@@ -21,7 +21,7 @@ def health():
|
||||
|
||||
@sock.route('/ws-upload')
|
||||
def ws_upload(ws):
|
||||
"""WebSocket: получает чанки, ACK после каждого"""
|
||||
"""WebSocket: получает чанки, считает байты и время"""
|
||||
t0 = time.time()
|
||||
total = 0
|
||||
while True:
|
||||
@@ -31,7 +31,6 @@ def ws_upload(ws):
|
||||
if isinstance(chunk, str) and chunk == 'DONE':
|
||||
break
|
||||
total += len(chunk)
|
||||
ws.send(json.dumps({'ack': total}))
|
||||
elapsed = round((time.time() - t0) * 1000)
|
||||
ws.send(json.dumps({'ok': True, 'bytes': total, 'elapsed_ms': elapsed}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user