Redis push в фоновом потоке (не блокирует ответ), v1.41
This commit is contained in:
+4
-2
@@ -180,8 +180,10 @@ class ContractsApp:
|
|||||||
finally:
|
finally:
|
||||||
db.put_conn(conn)
|
db.put_conn(conn)
|
||||||
|
|
||||||
# Файл — в Redis (мгновенно)
|
# Файл — в Redis (в фоне, не блокируем ответ)
|
||||||
redis_client.push({"filename": filename, "b64": b64, "mime": mime, "cid": str(cid)})
|
import threading
|
||||||
|
task = {"filename": filename, "b64": b64, "mime": mime, "cid": str(cid)}
|
||||||
|
threading.Thread(target=redis_client.push, args=(task,), daemon=True).start()
|
||||||
|
|
||||||
return jsonify({"contract_id": str(cid)})
|
return jsonify({"contract_id": str(cid)})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="topbar">
|
<div class="topbar">
|
||||||
<img src="{{ url_for('static', filename='nubes-logo.svg') }}" alt="Nubes">
|
<img src="{{ url_for('static', filename='nubes-logo.svg') }}" alt="Nubes">
|
||||||
<span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.40</span></span>
|
<span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.41</span></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|||||||
Reference in New Issue
Block a user