()
| 23 | } |
| 24 | |
| 25 | export function getRuntimeInstance(): RuntimeInstance { |
| 26 | const workspaceKey = configuredWorkspaceKey; |
| 27 | if (!workspaceKey) { |
| 28 | throw new Error('Runtime workspace key has not been configured'); |
| 29 | } |
| 30 | |
| 31 | runtimeInstance ??= { |
| 32 | instanceId: randomUUID(), |
| 33 | pid: process.pid, |
| 34 | workspaceKey, |
| 35 | }; |
| 36 | return runtimeInstance; |
| 37 | } |
| 38 | |
| 39 | export function getRuntimeInstanceIfConfigured(): RuntimeInstance | null { |
| 40 | if (runtimeInstance) { |
no outgoing calls
no test coverage detected