Skip to content

Commit

Permalink
Pass update from webhook to updates handler instead of `Dispatcher.pr…
Browse files Browse the repository at this point in the history
…ocess_update`
  • Loading branch information
JrooTJunior committed Mar 30, 2019
1 parent ccb8245 commit 4cc67ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aiogram/dispatcher/webhook.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import asyncio
import itertools

import asyncio.tasks
import datetime
import functools
Expand Down Expand Up @@ -165,7 +167,7 @@ async def process_update(self, update):
timeout_handle = loop.call_later(RESPONSE_TIMEOUT, asyncio.tasks._release_waiter, waiter)
cb = functools.partial(asyncio.tasks._release_waiter, waiter)

fut = asyncio.ensure_future(dispatcher.process_update(update), loop=loop)
fut = asyncio.ensure_future(dispatcher.updates_handler.notify(update), loop=loop)
fut.add_done_callback(cb)

try:
Expand Down Expand Up @@ -219,7 +221,7 @@ def get_response(self, results):
"""
if results is None:
return None
for result in results:
for result in itertools.chain.from_iterable(results):
if isinstance(result, BaseResponse):
return result

Expand Down

0 comments on commit 4cc67ea

Please sign in to comment.