From dd6ae1328100ba7339b995a64963711161230de3 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Mon, 12 Jun 2023 08:45:57 -0700 Subject: [PATCH] Changes the type of the connection timeout to be an int, not a float --- docs/configuration.md | 2 +- src/paperless/settings.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index da446401c..d3874256f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -136,7 +136,7 @@ changed here. Defaults to unset, using the documented path in the home directory. -`PAPERLESS_DB_TIMEOUT=` +`PAPERLESS_DB_TIMEOUT=` : Amount of time for a database connection to wait for the database to unlock. Mostly applicable for sqlite based installation. Consider changing diff --git a/src/paperless/settings.py b/src/paperless/settings.py index ad386e410..c18fd5717 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -532,14 +532,14 @@ def _parse_db_settings() -> Dict: if os.getenv("PAPERLESS_DB_TIMEOUT") is not None: if databases["default"]["ENGINE"] == "django.db.backends.sqlite3": databases["default"]["OPTIONS"].update( - {"timeout": float(os.getenv("PAPERLESS_DB_TIMEOUT"))}, + {"timeout": int(os.getenv("PAPERLESS_DB_TIMEOUT"))}, ) else: databases["default"]["OPTIONS"].update( - {"connect_timeout": float(os.getenv("PAPERLESS_DB_TIMEOUT"))}, + {"connect_timeout": int(os.getenv("PAPERLESS_DB_TIMEOUT"))}, ) databases["sqlite"]["OPTIONS"].update( - {"timeout": float(os.getenv("PAPERLESS_DB_TIMEOUT"))}, + {"timeout": int(os.getenv("PAPERLESS_DB_TIMEOUT"))}, ) return databases