Skip to content

Commit

Permalink
right, defer doesn't work like this
Browse files Browse the repository at this point in the history
  • Loading branch information
kamaln7 committed Oct 2, 2018
1 parent f8d478e commit 7e53298
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/webui/auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ func (a *Authenticator) ExpireClients() {
now := time.Now()

a.clientsMutex.Lock()
defer a.clientsMutex.Unlock()
for i := len(a.authedClients) - 1; i >= 0; i-- {
if now.Sub(a.authedClients[i].Added).Hours() >= 48 {
a.authedClients = append(a.authedClients[:i], a.authedClients[i+1:]...)
}
}
a.clientsMutex.Unlock()
}
}

Expand Down

0 comments on commit 7e53298

Please sign in to comment.