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

Method Close

internal/utils/bfs/blocks_file.go:311–329  ·  view source on GitHub ↗

Close 关闭当前文件

()

Source from the content-addressed store, hash-verified

309
310// Close 关闭当前文件
311func (this *BlocksFile) Close() error {
312 this.mu.Lock()
313 defer this.mu.Unlock()
314
315 if this.isClosed {
316 return nil
317 }
318
319 // TODO 决定是否同步
320 //_ = this.sync(true)
321
322 this.isClosed = true
323
324 _ = this.mFile.Close()
325
326 this.closeReaderPool()
327
328 return this.fp.Close()
329}
330
331// IsClosing 判断当前文件是否正在关闭或者已关闭
332func (this *BlocksFile) IsClosing() bool {

Callers

nothing calls this directly

Calls 4

closeReaderPoolMethod · 0.95
CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected