aiogram-template
aiogram-template copied to clipboard
webhooks using
It's the best template for aiogram3.0 I could find! But can you please to privide minimal example within webhook updates?
I've implemented webhooks as it is shown at aiogram3.0 example but in this case mongo fsm storage is crashes due to some low-level asynchronous things that I didn't understand, with error: RuntimeError: Task <Task pending name='Task-11' coro=<BaseRequestHandler._background_feed_update() running at /Volumes/Home/Library/Caches/pypoetry/virtualenvs/aiogram-template-VZ-Pzham-py3.10/lib/python3.10/site-packages/aiogram/dispatcher/webhook/aiohttp_server.py:124>> got Future <Future pending cb=[_chain_future.<locals>._call_check_cancel() at /usr/local/Cellar/[email protected]/3.10.1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/futures.py:384]> attached to a different loop
But still it's working fine with other fsm storages like redis. So I'm curious how to fix working with mongo storage because it's actually pretty convenient way to use fsm storage.
It's the best template for aiogram3.0 I could find! But can you please to privide minimal example within webhook updates?
Hi! I have never implemented webhooks in aiogram 3. Maybe I will in the future.
I've implemented webhooks as it is shown at aiogram3.0 example but in this case mongo fsm storage is crashes due to some low-level asynchronous things that I didn't understand, with error:
RuntimeError: Task <Task pending name='Task-11' coro=<BaseRequestHandler._background_feed_update() running at /Volumes/Home/Library/Caches/pypoetry/virtualenvs/aiogram-template-VZ-Pzham-py3.10/lib/python3.10/site-packages/aiogram/dispatcher/webhook/aiohttp_server.py:124>> got Future <Future pending cb=[_chain_future.<locals>._call_check_cancel() at /usr/local/Cellar/[email protected]/3.10.1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/futures.py:384]> attached to a different loop
But still it's working fine with other fsm storages like redis. So I'm curious how to fix working with mongo storage because it's actually pretty convenient way to use fsm storage.
I think this is because storage is implemented without real locks, but using asyncio Lock instead. I have not tried to implement locks in mongo yet, so I advise you to use either redis or polling
Are you sure you need webhooks? In my experience, the only time they're useful is when you're highloading and need to proxy requests to multiple bot instances. But I mean really high load