mirror of https://github.com/tidwall/tile38.git
Added flag for specifying event queue path
Use the `--queuefilename path` command flag For full in-memory queue use `--queuefilename :memory:`
This commit is contained in:
parent
7efa55f175
commit
7e16ac536b
|
@ -77,7 +77,8 @@ Basic Options:
|
||||||
Advanced Options:
|
Advanced Options:
|
||||||
--pidfile path : file that contains the pid
|
--pidfile path : file that contains the pid
|
||||||
--appendonly yes/no : AOF persistence (default: yes)
|
--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)
|
--http-transport yes/no : HTTP transport (default: yes)
|
||||||
--protected-mode yes/no : protected mode (default: yes)
|
--protected-mode yes/no : protected mode (default: yes)
|
||||||
|
|
||||||
|
@ -177,6 +178,13 @@ Developer Options:
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
core.AppendFileName = os.Args[i]
|
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":
|
case "--http-transport", "-http-transport":
|
||||||
i++
|
i++
|
||||||
if i < len(os.Args) {
|
if i < len(os.Args) {
|
||||||
|
|
|
@ -125,6 +125,9 @@ func ListenAndServeEx(host string, port int, dir string, ln *net.Listener, http
|
||||||
if core.AppendFileName == "" {
|
if core.AppendFileName == "" {
|
||||||
core.AppendFileName = path.Join(dir, "appendonly.aof")
|
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)
|
log.Infof("Server started, Tile38 version %s, git %s", core.Version, core.GitSHA)
|
||||||
c := &Controller{
|
c := &Controller{
|
||||||
|
@ -165,7 +168,7 @@ func ListenAndServeEx(host string, port int, dir string, ln *net.Listener, http
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// load the queue before the aof
|
// load the queue before the aof
|
||||||
qdb, err := buntdb.Open(path.Join(dir, "queue.db"))
|
qdb, err := buntdb.Open(core.QueueFileName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,3 +14,6 @@ var AppendOnly = "yes"
|
||||||
|
|
||||||
// AppendFileName allows for custom appendonly file path
|
// AppendFileName allows for custom appendonly file path
|
||||||
var AppendFileName string
|
var AppendFileName string
|
||||||
|
|
||||||
|
// QueueFileName allows for custom queue.db file path
|
||||||
|
var QueueFileName string
|
||||||
|
|
Loading…
Reference in New Issue