(instance: Instance, activeInstances: Set<string>)
| 77 | } |
| 78 | |
| 79 | async function resolveInstance(instance: Instance, activeInstances: Set<string>): Promise<void> { |
| 80 | try { |
| 81 | calcStats(instance); |
| 82 | const api = await getApiUrl(instance); |
| 83 | if (!api) { |
| 84 | handleUnresolvedApi(instance); |
| 85 | return; |
| 86 | } |
| 87 | activeInstances.add(instance.name); |
| 88 | await checkHealth(instance, api); |
| 89 | scheduleHealthCheck(instance, api); |
| 90 | } catch (error) { |
| 91 | console.error("Error resolving instance:", error); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | async function getApiUrl(instance: Instance): Promise<string | null> { |
| 96 | if (instance.urls) { |
no test coverage detected