From a4ad17b0383bd764020f9f4fad15ddb4d175c6f3 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 22 Jun 2024 21:16:56 +0800 Subject: [PATCH] :bug: Bug fixes on server register --- go.mod | 2 +- go.sum | 2 ++ pkg/internal/gap/server.go | 3 +-- pkg/main.go | 11 ++++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 61b5e72..cb1b31c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.6 require ( git.solsynth.dev/hydrogen/paperclip v0.0.0-20240622051057-0f56dba45745 - git.solsynth.dev/hydrogen/passport v0.0.0-20240622050421-7007cda8f210 + git.solsynth.dev/hydrogen/passport v0.0.0-20240622131052-18ae5f12e2e7 github.com/go-playground/validator/v10 v10.17.0 github.com/gofiber/fiber/v2 v2.52.4 github.com/gofiber/template/html/v2 v2.1.1 diff --git a/go.sum b/go.sum index f7b7fa6..59ec369 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ git.solsynth.dev/hydrogen/paperclip v0.0.0-20240622051057-0f56dba45745 h1:40BUsQ git.solsynth.dev/hydrogen/paperclip v0.0.0-20240622051057-0f56dba45745/go.mod h1:FsQGSLTl0gvo+9Jmbot02S72suyF9tFTrzDj70Xhifo= git.solsynth.dev/hydrogen/passport v0.0.0-20240622050421-7007cda8f210 h1:DM4AVhG/l3cOfmhA5IDFgn120BL2PEATnPQDtINIS/Q= git.solsynth.dev/hydrogen/passport v0.0.0-20240622050421-7007cda8f210/go.mod h1:XTNEOv75sZI52sNgpum7Z/tgYmlRcHfK7VdhyV7kc0w= +git.solsynth.dev/hydrogen/passport v0.0.0-20240622131052-18ae5f12e2e7 h1:4zoeDzrAY9/C9RaXsfv7vDE0cC/j94IR1vVpIQEEB6A= +git.solsynth.dev/hydrogen/passport v0.0.0-20240622131052-18ae5f12e2e7/go.mod h1:tUr7x1v0trG3ALDacdDuhJiPRPgFhJ1Si9OqNlYbgSk= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= diff --git a/pkg/internal/gap/server.go b/pkg/internal/gap/server.go index 061b423..e3664bf 100644 --- a/pkg/internal/gap/server.go +++ b/pkg/internal/gap/server.go @@ -18,11 +18,10 @@ func Register() error { return err } - httpBind := strings.SplitN(viper.GetString("bind"), ":", 2) grpcBind := strings.SplitN(viper.GetString("grpc_bind"), ":", 2) outboundIp, _ := GetOutboundIP() - port, _ := strconv.Atoi(httpBind[1]) + port, _ := strconv.Atoi(grpcBind[1]) registration := new(api.AgentServiceRegistration) registration.ID = viper.GetString("id") diff --git a/pkg/main.go b/pkg/main.go index c742bd7..fc3233e 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -1,7 +1,11 @@ package main import ( - "git.solsynth.dev/hydrogen/interactive/pkg/internal" + "os" + "os/signal" + "syscall" + + pkg "git.solsynth.dev/hydrogen/interactive/pkg/internal" "git.solsynth.dev/hydrogen/interactive/pkg/internal/database" "git.solsynth.dev/hydrogen/interactive/pkg/internal/gap" "git.solsynth.dev/hydrogen/interactive/pkg/internal/grpc" @@ -11,9 +15,6 @@ import ( "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/viper" - "os" - "os/signal" - "syscall" ) func init() { @@ -42,7 +43,7 @@ func main() { // Connect other services if err := gap.Register(); err != nil { - log.Fatal().Err(err).Msg("An error occurred when connecting to paperclip...") + log.Fatal().Err(err).Msg("An error occurred when connecting to consul...") } else { gap.NewHyperClient() }