fix(coderd/cryptokeys): relock mutex to avoid double unlock (#16802)

This commit is contained in:
Mathias Fredriksson
2025-03-04 19:10:12 +02:00
committed by GitHub
parent f21fcbd001
commit 6dd71b1055

View File

@ -251,14 +251,14 @@ func (c *cache) cryptoKey(ctx context.Context, sequence int32) (string, []byte,
}
c.fetching = true
c.mu.Unlock()
c.mu.Unlock()
keys, err := c.cryptoKeys(ctx)
c.mu.Lock()
if err != nil {
return "", nil, xerrors.Errorf("get keys: %w", err)
}
c.mu.Lock()
c.lastFetch = c.clock.Now()
c.refresher.Reset(refreshInterval)
c.keys = keys