( workspaceId: string, name: string )
| 55 | |
| 56 | // Helper function to get server history from cache |
| 57 | async function getServerHistoryFromCache( |
| 58 | workspaceId: string, |
| 59 | name: string |
| 60 | ): Promise<ServerStatusInfo[]> { |
| 61 | const cacheManager = await getCacheManager(); |
| 62 | const key = getServerHistoryCacheKey(workspaceId, name); |
| 63 | |
| 64 | const cachedValue = await cacheManager.get(key); |
| 65 | if (cachedValue) { |
| 66 | try { |
| 67 | return JSON.parse(String(cachedValue)); |
| 68 | } catch (err) { |
| 69 | logger.error('[ServerStatus] Error parsing cached history:', err); |
| 70 | return []; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | return []; |
| 75 | } |
| 76 | |
| 77 | // Helper function to save server history to cache |
| 78 | async function saveServerHistoryToCache( |
no test coverage detected