From aaf3a1f07b4277f3cb074483b500aa3ee9feff89 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Thu, 4 Apr 2024 19:37:33 +0800 Subject: [PATCH] fix: GetRandomSatisfiedChannel --- common/constants.go | 2 +- model/ability.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/constants.go b/common/constants.go index 85ecadd..416f4e0 100644 --- a/common/constants.go +++ b/common/constants.go @@ -111,7 +111,7 @@ var IsMasterNode = os.Getenv("NODE_TYPE") != "slave" var requestInterval, _ = strconv.Atoi(os.Getenv("POLLING_INTERVAL")) var RequestInterval = time.Duration(requestInterval) * time.Second -var SyncFrequency = GetOrDefault("SYNC_FREQUENCY", 10*60) // unit is second +var SyncFrequency = GetOrDefault("SYNC_FREQUENCY", 60) // unit is second var BatchUpdateEnabled = false var BatchUpdateInterval = GetOrDefault("BATCH_UPDATE_INTERVAL", 5) diff --git a/model/ability.go b/model/ability.go index 285ce15..f522967 100644 --- a/model/ability.go +++ b/model/ability.go @@ -57,7 +57,7 @@ func GetRandomSatisfiedChannel(group string, model string) (*Channel, error) { // Randomly choose one weight := common.GetRandomInt(int(weightSum)) for _, ability_ := range abilities { - weight -= int(ability_.Weight) + weight -= int(ability_.Weight) + 10 //log.Printf("weight: %d, ability weight: %d", weight, *ability_.Weight) if weight <= 0 { channel.Id = ability_.ChannelId