mirror of
https://github.com/coder/coder.git
synced 2026-10-31 02:43:21 +08:00
refactor: upgrade golangci-lint to v2.0.2 (#28416)
This commit is contained in:
+3
-3
@@ -64,7 +64,7 @@ func (api *API) debugTailnet(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Param force query boolean false "Force a healthcheck to run"
|
||||
func (api *API) debugDeploymentHealth(rw http.ResponseWriter, r *http.Request) {
|
||||
apiKey := httpmw.APITokenFromRequest(r)
|
||||
ctx, cancel := context.WithTimeout(r.Context(), api.Options.HealthcheckTimeout)
|
||||
ctx, cancel := context.WithTimeout(r.Context(), api.HealthcheckTimeout)
|
||||
defer cancel()
|
||||
|
||||
// Load sections previously marked as dismissed.
|
||||
@@ -78,7 +78,7 @@ func (api *API) debugDeploymentHealth(rw http.ResponseWriter, r *http.Request) {
|
||||
// Get cached report if it exists and the requester did not force a refresh.
|
||||
if !forced {
|
||||
if report := api.healthCheckCache.Load(); report != nil {
|
||||
if time.Since(report.Time) < api.Options.HealthcheckRefresh {
|
||||
if time.Since(report.Time) < api.HealthcheckRefresh {
|
||||
formatHealthcheck(ctx, rw, r, *report, dismissed...)
|
||||
return
|
||||
}
|
||||
@@ -87,7 +87,7 @@ func (api *API) debugDeploymentHealth(rw http.ResponseWriter, r *http.Request) {
|
||||
|
||||
resChan := api.healthCheckGroup.DoChan("", func() (*healthsdk.HealthcheckReport, error) {
|
||||
// Create a new context not tied to the request.
|
||||
ctx, cancel := context.WithTimeout(context.Background(), api.Options.HealthcheckTimeout)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), api.HealthcheckTimeout)
|
||||
defer cancel()
|
||||
|
||||
// Create and store progress tracker for timeout diagnostics.
|
||||
|
||||
Reference in New Issue
Block a user