fix
This commit is contained in:
parent
bd2f05e922
commit
8053c63973
@ -4,7 +4,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
consul "github.com/hashicorp/consul/api"
|
consul "github.com/hashicorp/consul/api"
|
||||||
@ -23,8 +22,6 @@ type Service struct {
|
|||||||
var ErrServiceUnavailable = fmt.Errorf("Service is unavailable")
|
var ErrServiceUnavailable = fmt.Errorf("Service is unavailable")
|
||||||
|
|
||||||
func NewService(serverAddr, appID, appName, ip, domain string, appPort int) (*Service, error) {
|
func NewService(serverAddr, appID, appName, ip, domain string, appPort int) (*Service, error) {
|
||||||
hostname, _ := os.Hostname()
|
|
||||||
fmt.Println("hostname:" + hostname)
|
|
||||||
s := new(Service)
|
s := new(Service)
|
||||||
s.AppID = appID
|
s.AppID = appID
|
||||||
s.Name = appName
|
s.Name = appName
|
||||||
@ -111,7 +108,7 @@ func (s *Service) check() (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) getTags() []string {
|
func (s *Service) getTags() []string {
|
||||||
fullName := fmt.Sprintf("%s_%s", s.Name, s.AppID)
|
fullName := fmt.Sprintf("%s-%s", s.Name, s.AppID)
|
||||||
bFullAddr := fmt.Sprintf("http://%s:%d/", s.IP, s.Port) // FIXME: declare one once - dont need to refresh....
|
bFullAddr := fmt.Sprintf("http://%s:%d/", s.IP, s.Port) // FIXME: declare one once - dont need to refresh....
|
||||||
|
|
||||||
tags := []string{
|
tags := []string{
|
||||||
|
Loading…
Reference in New Issue
Block a user