This commit is contained in:
孟帅
2024-04-22 23:08:40 +08:00
parent 82483bd7b9
commit e144b12580
445 changed files with 17457 additions and 6708 deletions

View File

@@ -13,12 +13,12 @@ import (
"hotgo/internal/library/hgrds/lock"
"hotgo/internal/library/hgrds/pubsub"
"hotgo/internal/service"
"hotgo/utility/simple"
)
// SubscribeClusterSync 订阅集群同步,可以用来集中同步数据、状态等
func SubscribeClusterSync(ctx context.Context) {
isCluster := g.Cfg().MustGet(ctx, "hotgo.isCluster").Bool()
if !isCluster {
if !simple.IsCluster(ctx) {
return
}
@@ -35,8 +35,7 @@ func SubscribeClusterSync(ctx context.Context) {
// PublishClusterSync 推送集群同步消息,如果没有开启集群部署,则不进行推送
func PublishClusterSync(ctx context.Context, channel string, message interface{}) {
isCluster := g.Cfg().MustGet(ctx, "hotgo.isCluster").Bool()
if !isCluster {
if !simple.IsCluster(ctx) {
return
}

View File

@@ -154,7 +154,7 @@ func InitTrace(ctx context.Context) {
// SetGFMode 设置gf运行模式
func SetGFMode(ctx context.Context) {
mode := g.Cfg().MustGet(ctx, "hotgo.mode").String()
mode := g.Cfg().MustGet(ctx, "system.mode").String()
if len(mode) == 0 {
mode = gmode.NOT_SET
}