()
| 33 | ) |
| 34 | |
| 35 | func GetPricing() []Pricing { |
| 36 | if time.Since(lastGetPricingTime) > time.Minute*1 || len(pricingMap) == 0 { |
| 37 | updatePricingLock.Lock() |
| 38 | defer updatePricingLock.Unlock() |
| 39 | // Double check after acquiring the lock |
| 40 | if time.Since(lastGetPricingTime) > time.Minute*1 || len(pricingMap) == 0 { |
| 41 | modelSupportEndpointsLock.Lock() |
| 42 | defer modelSupportEndpointsLock.Unlock() |
| 43 | updatePricing() |
| 44 | } |
| 45 | } |
| 46 | return pricingMap |
| 47 | } |
| 48 | |
| 49 | func GetModelSupportEndpointTypes(model string) []constant.EndpointType { |
| 50 | if model == "" { |
no test coverage detected