bugfix ledis-dbbench

This commit is contained in:
siddontang 2014-10-29 20:16:24 +08:00
parent 6572f3c719
commit a2c98cf359
1 changed files with 5 additions and 2 deletions

View File

@ -105,9 +105,12 @@ func main() {
flag.Parse() flag.Parse()
cfg := config.NewConfigDefault() cfg := config.NewConfigDefault()
cfg.DBPath = "./var/db_test" cfg.DataDir = "./var/ledis_dbbench"
cfg.DBName = *name cfg.DBName = *name
os.RemoveAll(cfg.DBPath) os.RemoveAll(cfg.DBPath)
defer os.RemoveAll(cfg.DBPath)
os.MkdirAll(cfg.DBPath, 0755)
cfg.LevelDB.BlockSize = 32 * KB cfg.LevelDB.BlockSize = 32 * KB
cfg.LevelDB.CacheSize = 512 * MB cfg.LevelDB.CacheSize = 512 * MB
@ -119,7 +122,7 @@ func main() {
var err error var err error
ldb, err = ledis.Open(cfg) ldb, err = ledis.Open(cfg)
if err != nil { if err != nil {
panic(err) println(err.Error())
return return
} }