mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix(coderd/cryptokeys): relock mutex to avoid double unlock (#16802)
This commit is contained in:
committed by
GitHub
parent
f21fcbd001
commit
6dd71b1055
@ -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
|
||||
|
Reference in New Issue
Block a user