( workspaceId: string )
| 15 | |
| 16 | // Helper function to get server map from cache |
| 17 | export async function getServerMapFromCache( |
| 18 | workspaceId: string |
| 19 | ): Promise<Record<string, ServerStatusInfo>> { |
| 20 | const cacheManager = await getCacheManager(); |
| 21 | const key = getServerMapCacheKey(workspaceId); |
| 22 | |
| 23 | const cachedValue = await cacheManager.get(key); |
| 24 | if (cachedValue) { |
| 25 | try { |
| 26 | return JSON.parse(String(cachedValue)); |
| 27 | } catch (err) { |
| 28 | logger.error('[ServerStatus] Error parsing cached server map:', err); |
| 29 | return {}; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | return {}; |
| 34 | } |
| 35 | |
| 36 | // Helper function to save server map to cache |
| 37 | async function saveServerMapToCache( |
no test coverage detected