Adds structured logging and fixes event reactivity.
This commit is contained in:
@@ -12,13 +12,8 @@ const services: Record<string, ServiceRecord> = {};
|
||||
const components: Record<string, any> = {};
|
||||
|
||||
async function pollURL(config: ServiceConfig): Promise<ServiceData> {
|
||||
try {
|
||||
const resp = await fetch(config.url);
|
||||
return { status: resp.ok ? 'online' : 'offline' };
|
||||
} catch (error) {
|
||||
console.warn(`could not poll '${config.url}': ` + error);
|
||||
return { status: 'offline' };
|
||||
}
|
||||
const resp = await fetch(config.url);
|
||||
return { status: resp.ok ? 'online' : 'offline' };
|
||||
}
|
||||
|
||||
function registerService(type: string, service: Partial<ServiceRecord>) {
|
||||
|
||||
Reference in New Issue
Block a user