* Synchronous version of getCacheDirectoryPath for use in getModelsFromCache. * Returns the cache directory path without async operations.
()
| 492 | * Returns the cache directory path without async operations. |
| 493 | */ |
| 494 | function getCacheDirectoryPathSync(): string | undefined { |
| 495 | try { |
| 496 | const globalStoragePath = ContextProxy.instance?.globalStorageUri?.fsPath |
| 497 | if (!globalStoragePath) { |
| 498 | return undefined |
| 499 | } |
| 500 | const cachePath = path.join(globalStoragePath, "cache") |
| 501 | return cachePath |
| 502 | } catch (error) { |
| 503 | console.error(`[MODEL_CACHE] Error getting cache directory path:`, error) |
| 504 | return undefined |
| 505 | } |
| 506 | } |
no test coverage detected