Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
fa87349
1
Parent(s):
1ed1e33
Update google_db.py
Browse files- google_db.py +5 -8
google_db.py
CHANGED
@@ -1,16 +1,13 @@
|
|
1 |
-
from flask import request, jsonify
|
2 |
-
import globs
|
3 |
-
import os
|
4 |
-
import asyncio
|
5 |
-
import aiohttp
|
6 |
-
|
7 |
-
api_variabl = os.getenv('api_key')
|
8 |
google_url = os.getenv('goo_url')
|
9 |
|
10 |
async def async_save_db(data):
|
11 |
async with aiohttp.ClientSession() as session:
|
12 |
async with session.post(google_url, data=data, headers={'Content-Type': 'application/x-www-form-urlencoded'}) as response:
|
13 |
-
|
|
|
|
|
|
|
|
|
14 |
|
15 |
def save_db():
|
16 |
err = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
google_url = os.getenv('goo_url')
|
2 |
|
3 |
async def async_save_db(data):
|
4 |
async with aiohttp.ClientSession() as session:
|
5 |
async with session.post(google_url, data=data, headers={'Content-Type': 'application/x-www-form-urlencoded'}) as response:
|
6 |
+
# Просто проверяем статус код, не ожидая тела ответа
|
7 |
+
if response.status == 200:
|
8 |
+
return True
|
9 |
+
else:
|
10 |
+
return False
|
11 |
|
12 |
def save_db():
|
13 |
err = 0
|