Adds configuration for database timeout, documentation and troubleshotting suggestion

This commit is contained in:
Trenton Holmes
2022-07-21 08:02:11 -07:00
parent 2b8c3ef02a
commit d689ef57f5
4 changed files with 51 additions and 9 deletions

View File

@@ -327,6 +327,13 @@ if os.getenv("PAPERLESS_DBHOST"):
if os.getenv("PAPERLESS_DBPORT"):
DATABASES["default"]["PORT"] = os.getenv("PAPERLESS_DBPORT")
if os.getenv("PAPERLESS_DB_TIMEOUT") is not None:
_new_opts = {"timeout": float(os.getenv("PAPERLESS_DB_TIMEOUT"))}
if "OPTIONS" in DATABASES["default"]:
DATABASES["default"]["OPTIONS"].update(_new_opts)
else:
DATABASES["default"]["OPTIONS"] = _new_opts
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
###############################################################################