🐛 Bug fixes on server register

This commit is contained in:
2024-06-22 21:16:56 +08:00
parent dc86e33b9e
commit a4ad17b038
4 changed files with 10 additions and 8 deletions

View File

@ -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")

View File

@ -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()
}