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

Method waitBFile

internal/utils/bfs/fs.go:418–442  ·  view source on GitHub ↗
(bPath string)

Source from the content-addressed store, hash-verified

416}
417
418func (this *FS) waitBFile(bPath string) error {
419 this.mu.RLock()
420 _, isClosing := this.closingBMap[bPath]
421 this.mu.RUnlock()
422 if !isClosing {
423 return nil
424 }
425
426 var maxWaits = 30_000
427 for {
428 this.mu.RLock()
429 _, isClosing = this.closingBMap[bPath]
430 this.mu.RUnlock()
431 if !isClosing {
432 break
433 }
434 time.Sleep(1 * time.Millisecond)
435 maxWaits--
436
437 if maxWaits < 0 {
438 return errors.New("open blocks file timeout")
439 }
440 }
441 return nil
442}

Callers 2

openBFileMethod · 0.95

Calls 2

RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by

no test coverage detected