Sync the db instance
()
| 134 | |
| 135 | // Sync the db instance |
| 136 | func (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 |
| 147 | func (db *DB) Put(key []byte, value []byte) error { |