-
Notifications
You must be signed in to change notification settings - Fork 150
Closed
Labels
questionA community question, closed when inactive.A community question, closed when inactive.
Description
- GINO version: 1.0.1
- Python version: 3.8
- asyncpg version: 0.21.0
- aiocontextvars version:
- PostgreSQL version: 11.6
Description
I'd like to set a maximum execution time for queries and cancel all queries server-side if limit is exceeded. Similar to the SET statement_timeout = 10000; in PostgreSQL.
Asyncpg has the connection parameter command_timeout, which seems to to the same thing. How can I make use of it in Gino with FastAPI?
What I Did
app = FastAPI(title="My App")
db = Gino(
app,
host=DATABASE_CONFIG.host,
port=DATABASE_CONFIG.port,
user=DATABASE_CONFIG.username,
password=DATABASE_CONFIG.password,
database=DATABASE_CONFIG.database,
pool_min_size=5,
pool_max_size=10,
command_timeout=10000
)This doesn't work.
How else can I set this option?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionA community question, closed when inactive.A community question, closed when inactive.