From efb8a9f296c9e48f4dee5c26a1cb3f9f594cec57 Mon Sep 17 00:00:00 2001 From: Martial BE Date: Tue, 2 Apr 2024 11:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Prices=20must=20be=20init?= =?UTF-8?q?ialized=20for=20the=20first=20run=20(#135)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- relay/util/pricing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay/util/pricing.go b/relay/util/pricing.go index 390acb8aa1bc6..7588428d4a81f 100644 --- a/relay/util/pricing.go +++ b/relay/util/pricing.go @@ -44,7 +44,7 @@ func NewPricing() { } // 初始化时,需要检测是否有更新 - if viper.GetBool("auto_price_updates") { + if viper.GetBool("auto_price_updates") || len(PricingInstance.Prices) == 0 { common.SysLog("Checking for pricing updates") prices := model.GetDefaultPrice() PricingInstance.SyncPricing(prices, false)