MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Close

Method Close

internal/utils/bfs/fs.go:143–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141}
142
143func (this *FS) Close() error {
144 if this.isClosed {
145 return nil
146 }
147
148 this.isClosed = true
149
150 close(this.closingBChan)
151 this.syncTicker.Stop()
152
153 var lastErr error
154 this.mu.Lock()
155 if len(this.bMap) > 0 {
156 var g = goman.NewTaskGroup()
157 for _, bFile := range this.bMap {
158 var bFileCopy = bFile
159 g.Run(func() {
160 err := bFileCopy.Close()
161 if err != nil {
162 lastErr = err
163 }
164 })
165 }
166
167 g.Wait()
168 }
169 this.mu.Unlock()
170
171 err := this.locker.Release()
172 if err != nil {
173 lastErr = err
174 }
175
176 return lastErr
177}
178
179func (this *FS) TestBMap() map[string]*BlocksFile {
180 return this.bMap

Callers

nothing calls this directly

Calls 8

NewTaskGroupFunction · 0.92
StopMethod · 0.65
CloseMethod · 0.65
LockMethod · 0.45
RunMethod · 0.45
WaitMethod · 0.45
UnlockMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected