Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 430e1c2

Browse files
committed
Add mutex lock to DBCache Close method
1 parent fe0b4e4 commit 430e1c2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

coderd/cryptokeys/dbkeycache.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,7 @@ func (d *DBCache) newTimer() *quartz.Timer {
183183
}
184184

185185
func (d *DBCache) Close() {
186+
d.keysMu.Lock()
187+
defer d.keysMu.Unlock()
186188
d.timer.Stop()
187189
}

0 commit comments

Comments
 (0)