()
| 59 | |
| 60 | /** Flush and dispose the analytics runtime (server shutdown). */ |
| 61 | export const disposeAnalytics = async (): Promise<void> => { |
| 62 | const runtime = analyticsRuntime; |
| 63 | if (!runtime) return; |
| 64 | analyticsRuntime = null; |
| 65 | await Effect.runPromise(Effect.promise(() => runtime.dispose()).pipe(Effect.ignoreCause())); |
| 66 | }; |
| 67 | |
| 68 | /** |
| 69 | * The execution-analytics `EngineDecorator`: every engine the shared stack |