1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 00:09:40 +02:00

fix(offlinegate): avoid leaking an RLock when the handler panics BE-11495 (#234)

This commit is contained in:
andres-portainer 2024-12-11 16:38:03 -03:00 committed by GitHub
parent e1388eff84
commit 94fda6a720
2 changed files with 31 additions and 1 deletions

View file

@ -45,7 +45,9 @@ func (o *OfflineGate) WaitingMiddleware(timeout time.Duration, next http.Handler
httperror.WriteError(w, http.StatusRequestTimeout, "Request timed out while waiting for the backup process to finish", http.ErrHandlerTimeout)
return
}
defer o.lock.RUnlock()
next.ServeHTTP(w, r)
o.lock.RUnlock()
})
}