Skip to content

Commit

Permalink
Add postgres statement_timeout to prevent database overloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Jun 16, 2023
1 parent 833ed17 commit bf7ac02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
# DATABASES
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
DB_STATEMENT_TIMEOUT = env.int("DB_STATEMENT_TIMEOUT", 60_000)
DATABASES = {
"default": env.db("DATABASE_URL"),
}
Expand All @@ -61,6 +62,7 @@
# https://github.com/jneight/django-db-geventpool#settings
"MAX_CONNS": DB_MAX_CONNS,
"REUSE_CONNS": env.int("DB_REUSE_CONNS", default=DB_MAX_CONNS),
"options": f"-c statement_timeout={DB_STATEMENT_TIMEOUT}",
}

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
Expand Down
2 changes: 1 addition & 1 deletion safe_transaction_service/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.20.0"
__version__ = "4.20.1"
__version_info__ = tuple(
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
Expand Down

0 comments on commit bf7ac02

Please sign in to comment.