MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / Sync

Method Sync

hintfile.go:441–453  ·  view source on GitHub ↗

Sync flushes the buffer and syncs the file to disk

()

Source from the content-addressed store, hash-verified

439
440// Sync flushes the buffer and syncs the file to disk
441func (w *HintFileWriter) Sync() error {
442 if w.writer != nil {
443 if err := w.writer.Flush(); err != nil {
444 return err
445 }
446 }
447
448 if w.file != nil {
449 return w.file.Sync()
450 }
451
452 return nil
453}
454
455// Close closes the hint file
456func (w *HintFileWriter) Close() error {

Callers 3

TestHintFileWriterReaderFunction · 0.95

Calls 2

SyncMethod · 0.65
FlushMethod · 0.45

Tested by 2

TestHintFileWriterReaderFunction · 0.76