feat: server-side ACK flow control (chunk→ack→next), bump 1.0.17
Deploy loadtest / validate (push) Waiting to run

This commit is contained in:
2026-07-11 06:44:23 +04:00
parent b509491c60
commit 2ccef934b4
2 changed files with 26 additions and 28 deletions
+3 -2
View File
@@ -7,7 +7,7 @@ from flask_sock import Sock
app = Flask(__name__)
sock = Sock(app)
VERSION = '1.0.16'
VERSION = '1.0.17'
@app.route('/')
@@ -22,7 +22,7 @@ def health():
@sock.route('/ws-upload')
def ws_upload(ws):
"""WebSocket: получает чанки, считает байты и время"""
"""WebSocket: получает чанки, ACK после каждого, считает байты и время"""
t0 = time.time()
total = 0
while True:
@@ -32,6 +32,7 @@ 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}))