()
| 12 | let fetchPromise = null |
| 13 | |
| 14 | // 缓存是否已过期(modelsCacheTtl = 0 表示永不过期) |
| 15 | const isCacheExpired = () => { |
| 16 | return config.modelsCacheTtl > 0 && Date.now() - cachedModelsAt > config.modelsCacheTtl * 1000 |
| 17 | } |
| 18 | |
| 19 | const getLatestModels = async (force = false) => { |