Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1018e24060 | |||
| ebef6e138d | |||
| 7bd8f754d8 | |||
| 43574a1d1c |
@@ -2,12 +2,11 @@ package consul
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"git.pbiernat.io/egommerce/go-api-pkg/config"
|
||||
"git.ego.cloudns.be/egommerce/go-api-pkg/config"
|
||||
consul "github.com/hashicorp/consul/api"
|
||||
"github.com/hashicorp/consul/connect"
|
||||
)
|
||||
@@ -61,7 +60,6 @@ func NewService(servAddr, id, name, useDomainOverIp, addr, domain, pathPrefix st
|
||||
|
||||
func newClientConfig(serverAddr string) *consul.Config {
|
||||
conf := consul.DefaultConfig()
|
||||
log.Printf("Setting consul server addr: %s", serverAddr)
|
||||
conf.Address = serverAddr
|
||||
|
||||
return conf
|
||||
@@ -129,7 +127,7 @@ func (s *Service) RegisterHealthChecks() {
|
||||
}()
|
||||
|
||||
go func() { // TTL
|
||||
t := time.NewTicker(s.ttl)
|
||||
t := time.NewTicker(time.Second * 5)
|
||||
for range t.C {
|
||||
if _, err := s.healthCheck(); err != nil {
|
||||
// fmt.Printf("HealthCheck endpoint not available (%s)#: %v\n", s.GetFullAddr(), err)
|
||||
|
||||
Reference in New Issue
Block a user