mirror of
https://github.com/nais/wonderwall.git
synced 2026-05-19 23:07:27 +00:00
fix(session/handler): log errors for lock release failures
This commit is contained in:
@@ -281,7 +281,12 @@ func (h *Handler) Refresh(r *http.Request, key string, data *Data) (*Data, error
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("while acquiring lock: %w", err)
|
||||
}
|
||||
defer lock.Release(ctx)
|
||||
defer func(lock Lock, ctx context.Context) {
|
||||
err := lock.Release(ctx)
|
||||
if err != nil {
|
||||
logger.Errorf("session: releasing lock: %+v", err)
|
||||
}
|
||||
}(lock, ctx)
|
||||
|
||||
// Get the latest session state again in case it was changed while acquiring the lock
|
||||
data, err = h.Get(r)
|
||||
|
||||
Reference in New Issue
Block a user