authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-05 19:10:11-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-05 23:40:49-08:00
log91cf202177b91719cbc7a67e6f5a685d309be691
tree8873e06a810e92049529f0ca16cbf4e6a20bf953
parentd21a8d597b4f876d63b2e884817d2a28f4e94bf3

Scope telemetry flush loop to service lifecycle

- Replace detached flush worker with scoped fiber in `AnalyticsService` - Ensure periodic analytics flushing is tied to layer lifetime/cleanup

1 files changed, 1 insertions(+), 1 deletions(-)

apps/server/src/telemetry/Layers/AnalyticsService.ts+1-1
...@@ -134,7 +134,7 @@ const makeAnalyticsService = Effect.gen(function* () {...@@ -134,7 +134,7 @@ const makeAnalyticsService = Effect.gen(function* () {
134134
135 yield* Effect.forever(Effect.sleep(1000).pipe(Effect.flatMap(() => flush)), {135 yield* Effect.forever(Effect.sleep(1000).pipe(Effect.flatMap(() => flush)), {
136 disableYield: true,136 disableYield: true,
137 }).pipe(Effect.forkDetach);137 }).pipe(Effect.forkScoped);
138138
139 yield* Effect.addFinalizer(() => flush);139 yield* Effect.addFinalizer(() => flush);
140140