diff --git a/cmd/tile38-server/main.go b/cmd/tile38-server/main.go index a4f71af5..0f3c6149 100644 --- a/cmd/tile38-server/main.go +++ b/cmd/tile38-server/main.go @@ -77,7 +77,8 @@ Basic Options: Advanced Options: --pidfile path : file that contains the pid --appendonly yes/no : AOF persistence (default: yes) - --appendonlyfile path : AOF path (default: data/appendonly.aof) + --appendfilename path : AOF path (default: data/appendonly.aof) + --queuefilename path : Event queue path (default:data/queue.db) --http-transport yes/no : HTTP transport (default: yes) --protected-mode yes/no : protected mode (default: yes) @@ -177,6 +178,13 @@ Developer Options: os.Exit(1) } core.AppendFileName = os.Args[i] + case "--queuefilename", "-queuefilename": + i++ + if i == len(os.Args) || os.Args[i] == "" { + fmt.Fprintf(os.Stderr, "queuefilename must have a value\n") + os.Exit(1) + } + core.QueueFileName = os.Args[i] case "--http-transport", "-http-transport": i++ if i < len(os.Args) { diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 4bdcc92f..504fe186 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -125,6 +125,9 @@ func ListenAndServeEx(host string, port int, dir string, ln *net.Listener, http if core.AppendFileName == "" { core.AppendFileName = path.Join(dir, "appendonly.aof") } + if core.QueueFileName == "" { + core.QueueFileName = path.Join(dir, "queue.db") + } log.Infof("Server started, Tile38 version %s, git %s", core.Version, core.GitSHA) c := &Controller{ @@ -165,7 +168,7 @@ func ListenAndServeEx(host string, port int, dir string, ln *net.Listener, http return err } // load the queue before the aof - qdb, err := buntdb.Open(path.Join(dir, "queue.db")) + qdb, err := buntdb.Open(core.QueueFileName) if err != nil { return err } diff --git a/pkg/core/options.go b/pkg/core/options.go index 1e62a9b1..3bba1298 100644 --- a/pkg/core/options.go +++ b/pkg/core/options.go @@ -14,3 +14,6 @@ var AppendOnly = "yes" // AppendFileName allows for custom appendonly file path var AppendFileName string + +// QueueFileName allows for custom queue.db file path +var QueueFileName string