tortoise-orm icon indicating copy to clipboard operation
tortoise-orm copied to clipboard

Default timeout unknown

Open ulysses500 opened this issue 1 year ago • 1 comments

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?

ulysses500 avatar Feb 09 '24 08:02 ulysses500

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:[email protected]:5432/somedb?timeout=10

lucasbrahm avatar Feb 29 '24 13:02 lucasbrahm