From a2c98cf359a687b0117ed9796cd8601a26a657b8 Mon Sep 17 00:00:00 2001 From: siddontang Date: Wed, 29 Oct 2014 20:16:24 +0800 Subject: [PATCH] bugfix ledis-dbbench --- cmd/ledis-dbbench/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/ledis-dbbench/main.go b/cmd/ledis-dbbench/main.go index 7f02d04..bfacc4c 100644 --- a/cmd/ledis-dbbench/main.go +++ b/cmd/ledis-dbbench/main.go @@ -105,9 +105,12 @@ func main() { flag.Parse() cfg := config.NewConfigDefault() - cfg.DBPath = "./var/db_test" + cfg.DataDir = "./var/ledis_dbbench" cfg.DBName = *name os.RemoveAll(cfg.DBPath) + defer os.RemoveAll(cfg.DBPath) + + os.MkdirAll(cfg.DBPath, 0755) cfg.LevelDB.BlockSize = 32 * KB cfg.LevelDB.CacheSize = 512 * MB @@ -119,7 +122,7 @@ func main() { var err error ldb, err = ledis.Open(cfg) if err != nil { - panic(err) + println(err.Error()) return }