Skip to content

Commit

Permalink
Add CONN_MAX_AGE setting to API (#2475)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend authored Jun 27, 2023
1 parent 26c863c commit 3864283
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/conf/settings/databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"USER": config("DJANGO_DATABASE_USER", default="deploy"),
"PASSWORD": config("DJANGO_DATABASE_PASSWORD", default="deploy"),
"NAME": config("DJANGO_DATABASE_NAME", default="openledger"),
# Default of 30 matches RDS documentation's advised max DNS caching time
# https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_BestPractices.html#CHAP_BestPractices.DiskPerformance
"CONN_MAX_AGE": config("DJANGO_CONN_MAX_AGE", default=30),
"CONN_HEALTH_CHECKS": config(
"DJANGO_CONN_HEALTH_CHECKS", default=True, cast=bool
),
"OPTIONS": {
"application_name": config(
"DJANGO_DATABASE_APPLICATION_NAME", default="openverse-api"
Expand Down

0 comments on commit 3864283

Please sign in to comment.