Compare commits
No commits in common. "c454307d56f2ea79d84b3caf1134ff8d3f32903a" and "3b73091cfb1c330f33241dc2f59752f5c22c2c3c" have entirely different histories.
c454307d56
...
3b73091cfb
@ -109,7 +109,7 @@ func (s *Service) RegisterHealthChecks() {
|
||||
}()
|
||||
|
||||
go func() { // TTL
|
||||
interval := s.ttl - (time.Second * 2) // 2 seconds overhead
|
||||
interval := s.ttl - time.Second*2 // 2 seconds overhead
|
||||
ticker := time.NewTicker(interval)
|
||||
for range ticker.C {
|
||||
if _, err := s.healthCheck(); err != nil {
|
||||
@ -149,14 +149,17 @@ func (s *Service) healthCheck() (bool, error) {
|
||||
}
|
||||
req.Header.Set("User-Agent", "service/internal")
|
||||
|
||||
fmt.Printf("Sending HEALTH CHECK request to: %s\n", healthUrl)
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
fmt.Printf("Sending HEALTH CHECK request error: %v\n", err)
|
||||
return false
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
var body []byte
|
||||
resp.Body.Read(body)
|
||||
fmt.Printf("HEALTH CHECK response to: %v -- %v\n", resp, body)
|
||||
|
||||
return resp.StatusCode == http.StatusOK
|
||||
}()
|
||||
@ -180,7 +183,7 @@ func (s *Service) getTags() []string {
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers." + s.Name + ".rule=PathPrefix(`" + s.pathPrefix + "`)",
|
||||
"traefik.http.routers." + s.Name + ".entryPoints=https",
|
||||
// "traefik.http.routers." + s.Name + ".tls=true",
|
||||
"traefik.http.routers." + s.Name + ".tls=true",
|
||||
"traefik.http.routers." + s.Name + ".service=" + s.Name,
|
||||
"traefik.http.routers." + s.Name + ".middlewares=auth_" + s.Name + ",requestid_" + s.Name + ",stripprefix_" + s.Name,
|
||||
"traefik.http.services." + s.Name + ".loadbalancer.server.scheme=http",
|
||||
|
Loading…
Reference in New Issue
Block a user