fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 41s
Deploy Dev / Push (pull_request) Successful in 27s
Deploy Dev / Deploy dev (pull_request) Successful in 14s
Deploy Prod / Build (pull_request) Successful in 42s
Deploy Prod / Push (pull_request) Successful in 27s
Deploy Prod / Deploy prod (pull_request) Successful in 10s
All checks were successful
Deploy Dev / Build (pull_request) Successful in 41s
Deploy Dev / Push (pull_request) Successful in 27s
Deploy Dev / Deploy dev (pull_request) Successful in 14s
Deploy Prod / Build (pull_request) Successful in 42s
Deploy Prod / Push (pull_request) Successful in 27s
Deploy Prod / Deploy prod (pull_request) Successful in 10s
This commit is contained in:
parent
7a99b36b00
commit
35dcc8390c
6
main.go
6
main.go
@ -53,12 +53,18 @@ func handlerWrapper(f func(*http.Request) (interface{}, int)) func(http.Response
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func metricProxy(w http.ResponseWriter, r *http.Request) {
|
||||||
|
http.Post("http://monitoring:1237/api/v1/metrics/task", "application/json", r.Body)
|
||||||
|
w.WriteHeader(202)
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
client.Connect()
|
client.Connect()
|
||||||
routers.MutexMap = make(map[string]*sync.Mutex)
|
routers.MutexMap = make(map[string]*sync.Mutex)
|
||||||
http.HandleFunc("/api/v1/take", handlerWrapper(routers.Take))
|
http.HandleFunc("/api/v1/take", handlerWrapper(routers.Take))
|
||||||
http.HandleFunc("/api/v1/finish", handlerWrapper(routers.Finish))
|
http.HandleFunc("/api/v1/finish", handlerWrapper(routers.Finish))
|
||||||
http.HandleFunc("/api/v1/put", handlerWrapper(routers.Put))
|
http.HandleFunc("/api/v1/put", handlerWrapper(routers.Put))
|
||||||
|
http.HandleFunc("/api/v1/metric", metricProxy)
|
||||||
log.Printf("Server started")
|
log.Printf("Server started")
|
||||||
http.ListenAndServe(":1239", nil)
|
http.ListenAndServe(":1239", nil)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user