( workspaceId: string, name: string, history: ServerStatusInfo[] )
| 76 | |
| 77 | // Helper function to save server history to cache |
| 78 | async function saveServerHistoryToCache( |
| 79 | workspaceId: string, |
| 80 | name: string, |
| 81 | history: ServerStatusInfo[] |
| 82 | ): Promise<void> { |
| 83 | const cacheManager = await getCacheManager(); |
| 84 | const key = getServerHistoryCacheKey(workspaceId, name); |
| 85 | |
| 86 | try { |
| 87 | await cacheManager.set(key, JSON.stringify(history)); |
| 88 | } catch (err) { |
| 89 | logger.error('[ServerStatus] Error saving history to cache:', err); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | createSubscribeInitializer('onServerStatusUpdate', async (workspaceId) => { |
| 94 | return await getServerMapFromCache(workspaceId); |
no test coverage detected