mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-18 06:50:05 +02:00
Merge pull request #460 from eitchtee/dev
fix: try to fix stale database connections (again)
This commit is contained in:
@@ -143,6 +143,9 @@ WSGI_APPLICATION = "WYGIWYH.wsgi.application"
|
|||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
|
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
|
||||||
|
|
||||||
|
THREADS = int(os.getenv("GUNICORN_THREADS", 1))
|
||||||
|
MAX_POOL_SIZE = THREADS + 1
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
"ENGINE": "django.db.backends.postgresql",
|
"ENGINE": "django.db.backends.postgresql",
|
||||||
@@ -151,8 +154,16 @@ DATABASES = {
|
|||||||
"PASSWORD": os.getenv("SQL_PASSWORD", "password"),
|
"PASSWORD": os.getenv("SQL_PASSWORD", "password"),
|
||||||
"HOST": os.getenv("SQL_HOST", "localhost"),
|
"HOST": os.getenv("SQL_HOST", "localhost"),
|
||||||
"PORT": os.getenv("SQL_PORT", "5432"),
|
"PORT": os.getenv("SQL_PORT", "5432"),
|
||||||
|
"CONN_MAX_AGE": 0,
|
||||||
|
"CONN_HEALTH_CHECKS": True,
|
||||||
"OPTIONS": {
|
"OPTIONS": {
|
||||||
"pool": True,
|
"pool": {
|
||||||
|
"min_size": 1,
|
||||||
|
"max_size": MAX_POOL_SIZE,
|
||||||
|
"timeout": 10,
|
||||||
|
"max_lifetime": 600,
|
||||||
|
"max_idle": 300,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,13 +137,13 @@ class UserSettingsForm(forms.ModelForm):
|
|||||||
self.helper.layout = Layout(
|
self.helper.layout = Layout(
|
||||||
"language",
|
"language",
|
||||||
"timezone",
|
"timezone",
|
||||||
HTML("<hr />"),
|
HTML('<hr class="hr my-3" />'),
|
||||||
"date_format",
|
"date_format",
|
||||||
"datetime_format",
|
"datetime_format",
|
||||||
"number_format",
|
"number_format",
|
||||||
HTML("<hr />"),
|
HTML('<hr class="hr my-3" />'),
|
||||||
"start_page",
|
"start_page",
|
||||||
HTML("<hr />"),
|
HTML('<hr class="hr my-3" />'),
|
||||||
"volume",
|
"volume",
|
||||||
FormActions(
|
FormActions(
|
||||||
NoClassSubmit("submit", _("Save"), css_class="btn btn-primary"),
|
NoClassSubmit("submit", _("Save"), css_class="btn btn-primary"),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% if field.help_text %}
|
{% if field.help_text %}
|
||||||
{% if help_text_inline %}
|
{% if help_text_inline %}
|
||||||
<span id="{{ field.auto_id }}_helptext" class="label text-wrap">{{ field.help_text|safe}}</span>
|
<span id="{{ field.auto_id }}_helptext" class="label text-wrap block">{{ field.help_text|safe}}</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p {% if field.auto_id %}id="{{ field.auto_id }}_helptext" {% endif %}class="label text-wrap">{{ field.help_text|safe }}</p>
|
<p {% if field.auto_id %}id="{{ field.auto_id }}_helptext" {% endif %}class="label text-wrap block">{{ field.help_text|safe }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user