quit with configSave()
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
c12d3a2dbb
commit
42d54a418d
12
http.go
12
http.go
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
pb "go.wit.com/lib/protobuf/virtbuf"
|
pb "go.wit.com/lib/protobuf/virtbuf"
|
||||||
|
@ -145,6 +146,17 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if route == "/quit" {
|
||||||
|
log.Warn("writing out config file and exiting virtigo")
|
||||||
|
fmt.Fprintln(w, "writing out config file and exiting virtigo")
|
||||||
|
if err := me.cluster.ConfigSave(); err != nil {
|
||||||
|
log.Info("configsave error", err)
|
||||||
|
} else {
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
log.Warn("BAD URL =", route)
|
log.Warn("BAD URL =", route)
|
||||||
fmt.Fprintln(w, "BAD URL tmp =", route)
|
fmt.Fprintln(w, "BAD URL tmp =", route)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue