mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-16 21:23:44 +08:00
🐛 fix: Prices must be initialized for the first run (#135)
This commit is contained in:
@@ -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")
|
common.SysLog("Checking for pricing updates")
|
||||||
prices := model.GetDefaultPrice()
|
prices := model.GetDefaultPrice()
|
||||||
PricingInstance.SyncPricing(prices, false)
|
PricingInstance.SyncPricing(prices, false)
|
||||||
|
|||||||
Reference in New Issue
Block a user