From e9586c3392deb6756e5ff81a8d2284dbc4685e61 Mon Sep 17 00:00:00 2001 From: Oren Zhang Date: Sat, 6 Jul 2024 13:51:44 +0800 Subject: [PATCH] feat: db conn timeout --- .cruft.json | 2 +- entry/settings.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.cruft.json b/.cruft.json index 63f26b5..6a79cd1 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/OVINC-CN/DevTemplateDjango.git", - "commit": "985721fafdb113da04bee7519d87803ec4e62252", + "commit": "6957e612ab3e625ffd602eeed7ddfa462ac2f296", "checkout": "main", "context": { "cookiecutter": { diff --git a/entry/settings.py b/entry/settings.py index 0f170fd..52fb6df 100644 --- a/entry/settings.py +++ b/entry/settings.py @@ -100,6 +100,7 @@ "PASSWORD": getenv_or_raise("DB_PASSWORD"), "HOST": getenv_or_raise("DB_HOST"), "PORT": int(getenv_or_raise("DB_PORT")), + "CONN_MAX_AGE": int(os.getenv("DB_CONN_MAX_AGE", str(60 * 60))), "OPTIONS": {"charset": "utf8mb4"}, } }