Skip to content

Commit

Permalink
Fix logout process.
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krivak committed Sep 6, 2023
1 parent ed38a1e commit 24f76de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ func (c *Collector) ServeHTTP(w http.ResponseWriter, r *http.Request) {
http500(w, "Collector error")
return
}
defer func() {
if err := client.Logout(r.Context()); err != nil {
log.Fatalf("Failed to logout: %v", err)
}
}()

reg := prometheus.NewRegistry()
c.collectCMState(r.Context(), reg, client)
Expand Down

0 comments on commit 24f76de

Please sign in to comment.