You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
It's very unhealthy for the database connection pools to always establish a new connection on each run. Also it's pretty bad to have a database connection always running (since there is maximum limit).
Hence, I would like to have a feature in the interval-py project to have a shared context for the actions, that you can access through the io object.
Imagine something like this (API borrowed from FastAPI):
@interval.on_event("startup")asyncdefstartup_event(io: IO):
""" Connect to the db. """io.state['pool'] =awaitcreate_pool(...)
It's very unhealthy for the database connection pools to always establish a new connection on each run. Also it's pretty bad to have a database connection always running (since there is maximum limit).
Hence, I would like to have a feature in the
interval-py
project to have a shared context for the actions, that you can access through theio
object.Imagine something like this (API borrowed from FastAPI):
Which then can be used generally:
The text was updated successfully, but these errors were encountered: