Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pikatasks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
django
pikatasks
Commits
4ef59600
Commit
4ef59600
authored
6 years ago
by
Art
Browse files
Options
Downloads
Patches
Plain Diff
Improve the CONN_MAX_AGE check
parent
819b7967
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pikatasks/django_compat.py
+3
-3
3 additions, 3 deletions
pikatasks/django_compat.py
with
3 additions
and
3 deletions
pikatasks/django_compat.py
+
3
−
3
View file @
4ef59600
...
...
@@ -39,9 +39,9 @@ def close_db_connections():
@requires_django
def
check_worker_db_settings
():
t
=
int
(
django_conf
.
settings
.
CONN_MAX_AGE
)
if
not
t
or
t
>
20
*
60
:
raise
ValueError
(
"
When using django, CONN_MAX_AGE must be set to a
sane value. The current value: {t} seconds.
"
.
format
(
t
=
t
))
conn_age_acceptable
=
range
(
10
,
20
*
60
)
# in seconds
if
getattr
(
django_conf
.
settings
,
"
CONN_MAX_AGE
"
,
0
)
not
in
conn_age_acceptable
:
raise
ValueError
(
"
When using django, CONN_MAX_AGE must be set to a
reasonable value. Accepted: {0}
"
.
format
(
conn_age_acceptable
))
@requires_django
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment