Skip to content

Commit

Permalink
Add app to request dict for subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscoder authored Aug 12, 2023
1 parent 8cef768 commit 00a2644
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aidbox_python_sdk/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ async def subscription(request, data):
if not handler:
logger.error("Subscription handler `{}` was not found".format(data["handler"]))
raise web.HTTPNotFound()
result = handler(data["event"], request)
data["request"]["app"] = request.app
result = handler(data["event"], data["request"])
if asyncio.iscoroutine(result):
asyncio.get_event_loop().create_task(result)
return web.json_response({})
Expand Down

0 comments on commit 00a2644

Please sign in to comment.