Changes the type of the connection timeout to be an int, not a float

This commit is contained in:
Trenton H 2023-06-12 08:45:57 -07:00
parent 3d85dc1127
commit dd6ae13281
2 changed files with 4 additions and 4 deletions

View File

@ -136,7 +136,7 @@ changed here.
Defaults to unset, using the documented path in the home directory. Defaults to unset, using the documented path in the home directory.
`PAPERLESS_DB_TIMEOUT=<float>` `PAPERLESS_DB_TIMEOUT=<int>`
: Amount of time for a database connection to wait for the database to : Amount of time for a database connection to wait for the database to
unlock. Mostly applicable for sqlite based installation. Consider changing unlock. Mostly applicable for sqlite based installation. Consider changing

View File

@ -532,14 +532,14 @@ def _parse_db_settings() -> Dict:
if os.getenv("PAPERLESS_DB_TIMEOUT") is not None: if os.getenv("PAPERLESS_DB_TIMEOUT") is not None:
if databases["default"]["ENGINE"] == "django.db.backends.sqlite3": if databases["default"]["ENGINE"] == "django.db.backends.sqlite3":
databases["default"]["OPTIONS"].update( databases["default"]["OPTIONS"].update(
{"timeout": float(os.getenv("PAPERLESS_DB_TIMEOUT"))}, {"timeout": int(os.getenv("PAPERLESS_DB_TIMEOUT"))},
) )
else: else:
databases["default"]["OPTIONS"].update( databases["default"]["OPTIONS"].update(
{"connect_timeout": float(os.getenv("PAPERLESS_DB_TIMEOUT"))}, {"connect_timeout": int(os.getenv("PAPERLESS_DB_TIMEOUT"))},
) )
databases["sqlite"]["OPTIONS"].update( databases["sqlite"]["OPTIONS"].update(
{"timeout": float(os.getenv("PAPERLESS_DB_TIMEOUT"))}, {"timeout": int(os.getenv("PAPERLESS_DB_TIMEOUT"))},
) )
return databases return databases