Skip to content

Commit 269ea9e

Browse files
committed
fix: reset restartAttempt in onReady instead of onStarted
Move the restartAttempt counter reset from the onStarted callback (fires when the process gets a PID) to the onReady callback (fires when the health check passes). This ensures exponential backoff is maintained for backends that repeatedly crash during initialization.
1 parent 6d22abb commit 269ea9e

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

apps/desktop/src/desktopBackendManager.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,16 +324,13 @@ export const makeDesktopBackendManager = Effect.fn("makeDesktopBackendManager")(
324324
...run,
325325
pid: Option.some(pid),
326326
}));
327-
yield* Ref.update(state, (latest) => ({
328-
...latest,
329-
restartAttempt: 0,
330-
}));
331327
yield* events.onStarted({ pid, config });
332328
}),
333329
onReady: () =>
334330
Effect.gen(function* () {
335331
yield* Ref.update(state, (latest) => ({
336332
...latest,
333+
restartAttempt: 0,
337334
ready: Option.match(latest.active, {
338335
onNone: () => latest.ready,
339336
onSome: (run) => (run.id === runId ? true : latest.ready),

0 commit comments

Comments
 (0)