1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 09:26:03 +00:00

fix(webvirtcloud): a PostgreSQL connection waits at most 5 seconds

libpq connects without a timeout of its own: a database server that
does not answer held each request for the operating system's TCP
timeout, minutes. The settings template sets connect_timeout to 5
seconds.
This commit is contained in:
catborise 2026-11-05 10:50:58 +03:00
parent 3001e40556
commit 5d2f8ff399
2 changed files with 5 additions and 0 deletions

View file

@ -149,6 +149,8 @@ if db_host := os.getenv("WEBVIRTCLOUD_DB_HOST"):
"NAME": os.getenv("WEBVIRTCLOUD_DB_NAME", "webvirtcloud"),
"USER": os.getenv("WEBVIRTCLOUD_DB_USER", "webvirtcloud"),
"PASSWORD": os.getenv("WEBVIRTCLOUD_DB_PASSWORD", ""),
# seconds to connect: libpq waits for the operating system's TCP timeout (minutes)
"OPTIONS": {"connect_timeout": 5},
}
}
else: