You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warnings_as_errors=True, # optional, default is True
60
58
),
61
59
),
62
60
]
63
61
```
64
62
65
-
## Threading
66
-
67
-
Django Health Check runs each check in a separate thread by default to improve performance. If you prefer to run the checks sequentially, you can set the `use_threading` parameter to `False` when instantiating the `HealthCheckView`, as shown in the example above.
68
-
69
-
This can be useful in environments where threads are not closing IO connections properly, leading to resource leaks.
70
-
However, for Django's database connections, threading is generally safe and recommended for better performance.
71
-
72
-
## Warnings as Errors
73
-
74
-
Treats `ServiceWarning` as errors, meaning they will cause the views to respond with a 500 status code. Default is `True`.
75
-
If set to `False` warnings will be displayed in the template or in the JSON response but the status code will remain a 200.
76
-
77
63
## Security
78
64
79
65
You can protect the health check endpoint by adding a secure token to your URL.
0 commit comments