Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default timeout unknown #1554

Open
ulysses500 opened this issue Feb 9, 2024 · 1 comment
Open

Default timeout unknown #1554

ulysses500 opened this issue Feb 9, 2024 · 1 comment

Comments

@ulysses500
Copy link

In the Tortoise ORM documentation, the default connect_timeout is set to None.

See: https://tortoise.github.io/databases.html#id5

What is the actual default timeout before it cancels the request?

@lucasbrahm
Copy link
Contributor

I don't think Tortoise set any default timeout, so the timeout is handled by the database library (for example, asyncpg). You can check that asyncpg uses libpq, which reads env PGCONNECT_TIMEOUT (https://www.postgresql.org/docs/current/libpq-envars.html). So you can set this env and it may work for you.

Anyway, in Tortoise I think you can set timeout by a query string in database URL, like this:
postgres://postgres:pass@db.host:5432/somedb?timeout=10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants