1、修改consul不能注册的bug

This commit is contained in:
wangjian 2023-03-24 08:49:41 +08:00
parent 46d29e280b
commit d72710bc8e
2 changed files with 3 additions and 1 deletions

View File

@ -77,7 +77,7 @@ func NewStartCmd() *cobra.Command {
//创建注册对象 //创建注册对象
tags := make([]string, 1) tags := make([]string, 1)
tags[0] = "control" tags[0] = "control"
consulCfg, err := discover.NewConsulConfig(cfg.Consul.Host, cfg.Name, cfg.Name, cfg.Consul.Host, cfg.Consul.Port, consulCfg, err := discover.NewConsulConfig(fmt.Sprintf("%s:%d", cfg.Consul.Host, cfg.Consul.Port), cfg.Name, cfg.Name, cfg.Consul.Host, cfg.Consul.Port,
tags, 300, 300, 300) tags, 300, 300, 300)
must(err) must(err)

View File

@ -1,6 +1,7 @@
package model package model
import ( import (
"fmt"
"go.uber.org/zap" "go.uber.org/zap"
"os" "os"
@ -26,6 +27,7 @@ func New(driveName, dsn string, showSql bool) {
&TaskResult{}, &TaskResult{},
) )
if err != nil { if err != nil {
fmt.Println("同步数据库表结构", err)
zap.L().Error("同步数据库表结构", zap.Error(err)) zap.L().Error("同步数据库表结构", zap.Error(err))
os.Exit(1) os.Exit(1)
} }