removed url from request client and use the url from logger init

main v1.0.9
alex 2023-10-09 19:27:47 +02:00
parent 8c150add43
commit fcc5d4e39b
1 changed files with 7 additions and 2 deletions

View File

@ -39,12 +39,17 @@ type LogManagerRequestBody struct {
Logs []string Logs []string
} }
func LogManagerRequestClient(requestMethod string, url string, body interface{}) { func LogManagerRequestClient(requestMethod string, body interface{}) {
if usedLogManagerServerUrl == "" {
log.Error().Msgf("Log manager server url is not set, skipping request")
return
}
a := fiber.AcquireAgent() a := fiber.AcquireAgent()
req := a.Request() req := a.Request()
req.Header.SetMethod(requestMethod) req.Header.SetMethod(requestMethod)
req.SetRequestURI(url) req.SetRequestURI(usedLogManagerServerUrl + "/v1/log")
req.Header.SetContentType("application/json") req.Header.SetContentType("application/json")
reqestBodyBytes, err := json.Marshal(body) reqestBodyBytes, err := json.Marshal(body)