Skip to content

Commit

Permalink
Fix mangum db connection pool
Browse files Browse the repository at this point in the history
  • Loading branch information
ividito committed Jan 13, 2023
1 parent a45fbb4 commit 0075d5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion raster_api/runtime/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
logging.getLogger("mangum.http").setLevel(logging.ERROR)


handler = Mangum(app, lifespan="auto")
handler = Mangum(app, lifespan="off")

if "AWS_EXECUTION_ENV" in os.environ:
loop = asyncio.get_event_loop()
loop.run_until_complete(app.router.startup())

# Add tracing
handler.__name__ = "handler" # tracer requires __name__ to be set
Expand Down

0 comments on commit 0075d5d

Please sign in to comment.