MCPcopy Create free account
hub / github.com/Roy3838/Observer / checkLocalServer

Function checkLocalServer

app/src/components/AppHeader.tsx:299–323  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297 };
298
299 const checkLocalServer = async () => {
300 try {
301 Logger.info('SERVER', `Checking local server connection at ${LOCAL_SERVER_ADDRESS}...`);
302 const result = await checkInferenceServer(LOCAL_SERVER_ADDRESS);
303
304 if (result.status === 'online') {
305 setLocalServerOnline(true);
306 addInferenceAddress(LOCAL_SERVER_ADDRESS);
307 Logger.info('SERVER', `Local server at ${LOCAL_SERVER_ADDRESS} is online and added to inference addresses`);
308 // Update model list when server comes online
309 await fetchModels();
310 } else {
311 setLocalServerOnline(false);
312 removeInferenceAddress(LOCAL_SERVER_ADDRESS);
313 Logger.warn('SERVER', `Local server at ${LOCAL_SERVER_ADDRESS} is offline: ${result.error}`);
314 // Update model list when server goes offline
315 await fetchModels();
316 }
317 } catch (err) {
318 setLocalServerOnline(false);
319 removeInferenceAddress(LOCAL_SERVER_ADDRESS);
320 const errorMessage = err instanceof Error ? err.message : 'Unknown error';
321 Logger.error('SERVER', `Error checking local server: ${errorMessage}`, err);
322 }
323 };
324
325
326 const checkLocalServerOnly = async () => {

Callers 3

checkLocalServerOnlyFunction · 0.85
AppHeaderFunction · 0.85
handleSetAppInferenceUrlFunction · 0.85

Calls 7

checkInferenceServerFunction · 0.90
addInferenceAddressFunction · 0.90
fetchModelsFunction · 0.90
removeInferenceAddressFunction · 0.90
infoMethod · 0.80
warnMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected