MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / Sync

Method Sync

engine/db.go:136–144  ·  view source on GitHub ↗

Sync the db instance

()

Source from the content-addressed store, hash-verified

134
135// Sync the db instance
136func (db *DB) Sync() error {
137 zap.L().Info("sync db", zap.Any("options", db.options))
138 if db.activeFile == nil {
139 return nil
140 }
141 db.lock.Lock()
142 defer db.lock.Unlock()
143 return db.activeFile.Sync()
144}
145
146// Put write a key-value pair to db, and the key must be not empty
147func (db *DB) Put(key []byte, value []byte) error {

Callers 2

MergeMethod · 0.95
TestDB_SyncFunction · 0.95

Calls 1

SyncMethod · 0.65

Tested by 1

TestDB_SyncFunction · 0.76