Fix parser test, fix handler
parent
f2d132b361
commit
7269647bfd
|
@ -94,6 +94,10 @@ func NewHandler(s *influxdb.Server, requireAuthentication bool, version string)
|
|||
"ping-head",
|
||||
"HEAD", "/ping", h.servePing, true,
|
||||
},
|
||||
route{ // Tell data node to run CQs that should be run
|
||||
"process_continuous_queries",
|
||||
"POST", "/process_continuous_queries", h.serveProcessContinuousQueries,
|
||||
},
|
||||
)
|
||||
|
||||
for _, r := range h.routes {
|
||||
|
@ -322,6 +326,16 @@ func (h *Handler) serveDeleteDataNode(w http.ResponseWriter, r *http.Request) {
|
|||
w.WriteHeader(http.StatusNoContent)
|
||||
}
|
||||
|
||||
// serveProcessContinuousQueries will execute any continuous queries that should be run
|
||||
func (h *Handler) serveProcessContinuousQueries(w http.ResponseWriter, r *http.Request, u *influxdb.User) {
|
||||
if err := h.server.RunContinuousQueries(); err != nil {
|
||||
httpError(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
}
|
||||
|
||||
type dataNodeJSON struct {
|
||||
ID uint64 `json:"id"`
|
||||
URL string `json:"url"`
|
||||
|
|
Loading…
Reference in New Issue