This repository has been archived on 2022-07-30. You can view files and clone it, but cannot push or open issues/pull-requests.
mdb/kvstore/util.go

27 lines
486 B
Go

package kvstore
import (
"path/filepath"
"time"
)
const (
commitInterval = 250 * time.Millisecond // How often to commit from WAL.
cleanInterval = time.Minute // How often to clean WAL.
cleanBeforeSecs = 86400 * 7 // Clean WAL entries older than.
)
func must(err error) {
if err != nil {
panic(err)
}
}
func dataPath(dir string) string {
return filepath.Join(dir, "data")
}
func walPath(dir string) string {
return filepath.Join(dir, "wal")
}