Skip to content

Commit 50201cc

Browse files
authored
Merge pull request #6759 from readthedocs/proxito-mixin
Expand the logic in our proxito mixin.
2 parents 5691b4e + 20017da commit 50201cc

File tree

1 file changed

+10
-0
lines changed
  • readthedocs/settings/proxito

1 file changed

+10
-0
lines changed

readthedocs/settings/proxito/base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@
66
a staged rollout of the proxito code.
77
"""
88

9+
910
class CommunityProxitoSettingsMixin:
1011

1112
ROOT_URLCONF = 'readthedocs.proxito.urls'
1213
USE_SUBDOMAIN = True
1314

15+
@property
16+
def DATABASES(self):
17+
# This keeps connections to the DB alive,
18+
# which reduces latency with connecting to postgres
19+
dbs = getattr(super(), 'DATABASES', {})
20+
for db in dbs.keys():
21+
dbs[db]['CONN_MAX_AGE'] = 86400
22+
return dbs
23+
1424
@property
1525
def MIDDLEWARE(self): # noqa
1626
# Use our new middleware instead of the old one

0 commit comments

Comments
 (0)