Skip to content

Commit 6dd71b1

Browse files
authored
fix(coderd/cryptokeys): relock mutex to avoid double unlock (#16802)
1 parent f21fcbd commit 6dd71b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/cryptokeys/cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,14 @@ func (c *cache) cryptoKey(ctx context.Context, sequence int32) (string, []byte,
251251
}
252252

253253
c.fetching = true
254-
c.mu.Unlock()
255254

255+
c.mu.Unlock()
256256
keys, err := c.cryptoKeys(ctx)
257+
c.mu.Lock()
257258
if err != nil {
258259
return "", nil, xerrors.Errorf("get keys: %w", err)
259260
}
260261

261-
c.mu.Lock()
262262
c.lastFetch = c.clock.Now()
263263
c.refresher.Reset(refreshInterval)
264264
c.keys = keys

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy