🐛 fix: Prices must be initialized for the first run (#135)

This commit is contained in:
Martial BE 2024-04-02 11:18:19 +08:00
parent 5819a034e8
commit efb8a9f296
No known key found for this signature in database
GPG Key ID: D06C32DF0EDB9084

View File

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