bugfix for repair

db must use defer to close
This commit is contained in:
siddontang 2014-07-02 10:11:16 +08:00
parent 2cc4a7056b
commit b5400e8056
2 changed files with 2 additions and 3 deletions

View File

@ -9,7 +9,7 @@ import (
"path"
)
var fileName = flag.String("config", "/etc/ledis.config", "ledisdb config file")
var fileName = flag.String("config", "/etc/ledis.json", "ledisdb config file")
func main() {
flag.Parse()

View File

@ -88,8 +88,7 @@ func Repair(cfg *Config) error {
db.cfg = cfg
err := db.open()
db.Close()
defer db.Close()
//open ok, do not need repair
if err == nil {