pricing_refresh.go 377 B

1234567891011121314
  1. package model
  2. // RefreshPricing 强制立即重新计算与定价相关的缓存。
  3. // 该方法用于需要最新数据的内部管理 API,
  4. // 因此会绕过默认的 1 分钟延迟刷新。
  5. func RefreshPricing() {
  6. updatePricingLock.Lock()
  7. defer updatePricingLock.Unlock()
  8. modelSupportEndpointsLock.Lock()
  9. defer modelSupportEndpointsLock.Unlock()
  10. updatePricing()
  11. }