Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
45453fb
1
Parent(s):
a0d46bb
Update google_db.py
Browse files- google_db.py +8 -3
google_db.py
CHANGED
@@ -37,12 +37,17 @@ def save_db():
|
|
37 |
|
38 |
data = f"action=addData&dey={dey_db}&wek={wek_db}&v_hid={v_hid_db}&v_min={v_min_db}&ph={ph_db}&ec={ec_db}&tS={tS_db}&tA={tA_db}&hDm={hDm_db}&sVen={sVen_db}&ec_A_eep={ec_A_eep_db}&ec_B_eep={ec_B_eep_db}&ec_C_eep={ec_C_eep_db}"
|
39 |
|
40 |
-
#
|
41 |
-
asyncio.
|
42 |
|
43 |
response_data = {
|
44 |
"eep_set": globs.eep_set,
|
45 |
"err": err
|
46 |
}
|
47 |
|
48 |
-
return jsonify(response_data)
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
data = f"action=addData&dey={dey_db}&wek={wek_db}&v_hid={v_hid_db}&v_min={v_min_db}&ph={ph_db}&ec={ec_db}&tS={tS_db}&tA={tA_db}&hDm={hDm_db}&sVen={sVen_db}&ec_A_eep={ec_A_eep_db}&ec_B_eep={ec_B_eep_db}&ec_C_eep={ec_C_eep_db}"
|
39 |
|
40 |
+
# Отправляем корутину в существующий цикл событий
|
41 |
+
asyncio.run_coroutine_threadsafe(async_save_db(data), app.loop)
|
42 |
|
43 |
response_data = {
|
44 |
"eep_set": globs.eep_set,
|
45 |
"err": err
|
46 |
}
|
47 |
|
48 |
+
return jsonify(response_data)
|
49 |
+
|
50 |
+
@app.route("/save_db", methods=['GET'])
|
51 |
+
def handle_save_db():
|
52 |
+
response = save_db()
|
53 |
+
return response
|