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

Method sync

internal/utils/bfs/blocks_file.go:365–390  ·  view source on GitHub ↗
(force bool)

Source from the content-addressed store, hash-verified

363}
364
365func (this *BlocksFile) sync(force bool) error {
366 if !force {
367 if this.writtenBytes < this.opt.BytesPerSync {
368 return nil
369 }
370 }
371
372 if this.writtenBytes > 0 {
373 AckWriteThread()
374 err := this.fp.Sync()
375 ReleaseWriteThread()
376 if err != nil {
377 return err
378 }
379 }
380
381 this.writtenBytes = 0
382
383 this.syncAt = time.Now()
384
385 if force {
386 return this.mFile.SyncUnsafe()
387 }
388
389 return nil
390}
391
392func (this *BlocksFile) closeReaderPool() {
393 for {

Callers 2

SyncMethod · 0.95
ForceSyncMethod · 0.95

Calls 4

AckWriteThreadFunction · 0.85
ReleaseWriteThreadFunction · 0.85
SyncUnsafeMethod · 0.80
SyncMethod · 0.45

Tested by

no test coverage detected