Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4a93e99

Browse files
committed
set cache to nil to signal closed
1 parent96e3cbb commit4a93e99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎coderd/files/closer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ type CacheCloser struct {
1515

1616
closers []func()
1717
mu sync.Mutex
18-
closedbool
1918
}
2019

2120
funcNewCacheCloser(cacheFileAcquirer)*CacheCloser {
@@ -32,8 +31,9 @@ func (c *CacheCloser) Close() {
3231
for_,doClose:=rangec.closers {
3332
doClose()
3433
}
35-
c.closed=true
3634

35+
// Prevent further acquisitions
36+
c.cache=nil
3737
// Remove any references
3838
c.closers=make([]func(),0)
3939
}
@@ -42,7 +42,7 @@ func (c *CacheCloser) Acquire(ctx context.Context, fileID uuid.UUID) (*CloseFS,
4242
c.mu.Lock()
4343
deferc.mu.Unlock()
4444

45-
ifc.closed {
45+
ifc.cache==nil {
4646
returnnil,xerrors.New("cache is closed, and cannot acquire new files")
4747
}
4848

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp