MCPcopy
hub / github.com/msgbyte/tianji / saveServerMapToCache

Function saveServerMapToCache

src/server/model/serverStatus.ts:37–49  ·  view source on GitHub ↗
(
  workspaceId: string,
  serverMap: Record<string, ServerStatusInfo>
)

Source from the content-addressed store, hash-verified

35
36// Helper function to save server map to cache
37async function saveServerMapToCache(
38 workspaceId: string,
39 serverMap: Record<string, ServerStatusInfo>
40): Promise<void> {
41 const cacheManager = await getCacheManager();
42 const key = getServerMapCacheKey(workspaceId);
43
44 try {
45 await cacheManager.set(key, JSON.stringify(serverMap));
46 } catch (err) {
47 logger.error('[ServerStatus] Error saving server map to cache:', err);
48 }
49}
50
51// Helper function to get cache key for server history
52function getServerHistoryCacheKey(workspaceId: string, name: string): string {

Callers 2

recordServerStatusFunction · 0.85
clearOfflineServerStatusFunction · 0.85

Calls 3

getCacheManagerFunction · 0.85
getServerMapCacheKeyFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected