-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ошибка при попытке вызова из Google Cloud Functions #154
Comments
Пытаюсь повторить проблему. Запускаю Google Cloud Function следующего вида: import asyncio
def ensure_loop():
try:
asyncio.get_event_loop()
except RuntimeError:
asyncio.set_event_loop(asyncio.new_event_loop())
async def func():
print("Async func running!")
def hello_world(request):
caught = False
print("First try")
try:
event = asyncio.Event()
except:
caught = True
assert caught
print("First try OK. Second try...")
ensure_loop()
event = asyncio.Event()
print("Second try OK. Running async...")
loop = asyncio.get_event_loop()
loop.run_until_complete(func())
return "OK" Получаю ошибку:
То есть,. проблем с получением loop вроде нет. |
Кроме того, пробуя функцию: import fast_bitrix24
def hello_world(request):
bx = fast_bitrix24.Bitrix("XXXXXXX")
return {"result": bx.call("crm.lead.list", {"select": ["ID"]})} получаю вполне валидный результат. Проблему закрываю -- не смог повторить. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Вызывающий код:
The text was updated successfully, but these errors were encountered: