diff --git a/server/cmd/main.go b/server/cmd/main.go index ddca128..712fe6e 100644 --- a/server/cmd/main.go +++ b/server/cmd/main.go @@ -23,7 +23,7 @@ import ( ) type args struct { - Port string `arg:"-p" help:"web server port, default :8090"` + Port string `arg:"-p" help:"web server port, default 8090"` Path string `arg:"-d" help:"database dir path"` LogPath string `arg:"-l" help:"server log file path"` WebLogPath string `arg:"-w" help:"web access log file path"` diff --git a/server/settings/db.go b/server/settings/db.go index d914ef8..05c9c92 100644 --- a/server/settings/db.go +++ b/server/settings/db.go @@ -3,6 +3,7 @@ package settings import ( "path/filepath" "strings" + "time" "server/log" @@ -15,7 +16,7 @@ type TDB struct { } func NewTDB() *TDB { - db, err := bolt.Open(filepath.Join(Path, "config.db"), 0666, nil) + db, err := bolt.Open(filepath.Join(Path, "config.db"), 0666, &bolt.Options{Timeout: 5 * time.Second}) if err != nil { log.TLogln(err) return nil diff --git a/server/torr/btserver.go b/server/torr/btserver.go index e4c2214..4bc4537 100644 --- a/server/torr/btserver.go +++ b/server/torr/btserver.go @@ -146,7 +146,7 @@ func (bt *BTServer) configure(ctx context.Context) { } log.Println("Client config:", settings.BTsets) - + var err error // set public IPv4