Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 003bf2bb88 | |||
| 03ec5a0a5a | |||
| fb251e3648 | |||
| 32a89d9747 | |||
| 3b6acdc195 | |||
| 128e3db0b6 |
@@ -81,9 +81,13 @@ func (s *Service) Register() error {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
go func() { // TTL
|
go func() { // TTL
|
||||||
ticker := time.NewTicker(s.TTL)
|
interval := s.TTL - time.Second*2
|
||||||
|
ticker := time.NewTicker(interval)
|
||||||
for range ticker.C {
|
for range ticker.C {
|
||||||
s.healthCheck()
|
_, err := s.healthCheck()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("TTL Error: %v\n", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -128,7 +132,7 @@ func (s *Service) healthCheck() (bool, error) {
|
|||||||
func (s *Service) getTags() []string {
|
func (s *Service) getTags() []string {
|
||||||
tags := []string{
|
tags := []string{
|
||||||
"traefik.enable=true",
|
"traefik.enable=true",
|
||||||
"traefik.http.routers." + s.Name + ".rule=Host(`" + s.Domain + "`)",
|
"traefik.http.routers." + s.Name + ".rule=Headers(`X-API-SERVICE`, `" + s.Domain + "`)",
|
||||||
"traefik.http.routers." + s.Name + ".entryPoints=https",
|
"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 + ".service=" + s.Name,
|
||||||
|
|||||||
Reference in New Issue
Block a user