register fix

This commit is contained in:
Piotr Biernat 2022-12-01 23:24:25 +01:00
parent 34ace207a7
commit e5c95b0476

View File

@ -23,16 +23,16 @@ type Service struct {
var ErrServiceUnavailable = fmt.Errorf("Service is unavailable")
func NewService(serverAddr, appID, appName, ip, domain string, appPort int) (*Service, error) {
func NewService(servAddr, id, appName, ip, domain string, appPort int) (*Service, error) {
s := new(Service)
s.AppID = appID
s.AppID = id
s.Name = strings.Replace(appName, "-", "", -1)
s.Address = domain
s.IP = ip
s.Port = appPort
s.TTL = time.Second * 15
client, err := consul.NewClient(newClientConfig(serverAddr))
client, err := consul.NewClient(newClientConfig(servAddr))
if err != nil {
return nil, err
}