(
request: {
sessionPath?: string | undefined | null | undefined
projectPath?: string | undefined | null | undefined
} = {},
)
| 504 | } |
| 505 | |
| 506 | export async function invalidateRuntimeHostSettings( |
| 507 | request: { |
| 508 | sessionPath?: string | undefined | null | undefined |
| 509 | projectPath?: string | undefined | null | undefined |
| 510 | } = {}, |
| 511 | ) { |
| 512 | const targets = new Set<HostConnection>() |
| 513 | if (request.sessionPath) { |
| 514 | const host = hostByAlias.get(request.sessionPath) |
| 515 | if (host) targets.add(host) |
| 516 | } else { |
| 517 | for (const host of hosts) targets.add(host) |
| 518 | } |
| 519 | |
| 520 | await Promise.all( |
| 521 | [...targets].filter(isHostRunningOrStarting).map((host) => |
| 522 | invokeRuntimeHostOnHost(host, 'invalidateRuntimeSettings', request).catch((error) => { |
| 523 | console.warn(`Failed to invalidate Pi runtime host settings (${host.label}).`, error) |
| 524 | }), |
| 525 | ), |
| 526 | ) |
| 527 | } |
| 528 | |
| 529 | async function invokeRuntimeHostOnHost<TName extends RuntimeHostRequestName>( |
| 530 | host: HostConnection, |
no test coverage detected