Skip to content

Commit 6d16dd9

Browse files
committed
fix(server): explain why restore failures leave services stopped
1 parent 490012d commit 6d16dd9

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎apps/server/src/cloud/bootService.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,9 +865,12 @@ it.layer(NodeServices.layer)("boot service install", (it) => {
865865
expect(
866866
yield* fs.readFileString(markerPath).pipe(Effect.orElseSucceed(() => undefined)),
867867
).toBe(hasMarker ? "1.2.3\n" : undefined);
868-
expect(yield* fs.readFileString(plan.logPath)).toContain(
869-
"Could not set up the T3 Code background service.",
868+
const log = yield* fs.readFileString(plan.logPath);
869+
expect(log).toContain("Could not set up the T3 Code background service.");
870+
expect(log).toContain(
871+
"Restoring the previous background service failed. The service was left stopped.",
870872
);
873+
expect(log).not.toContain("missing-restore-source");
871874
}),
872875
);
873876

‎apps/server/src/cloud/bootService.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,13 @@ export const make = Effect.fn("cloud.boot_service.make")(function* (input: {
959959
}),
960960
);
961961
}
962-
if (restoreError !== undefined) return yield* restoreError;
962+
if (restoreError !== undefined) {
963+
yield* logFailure({
964+
message:
965+
"Restoring the previous background service failed. The service was left stopped.",
966+
});
967+
return yield* restoreError;
968+
}
963969
// systemd may already have loaded the replacement definition.
964970
if (activationStarted && previousUnit !== manager.render(plan)) {
965971
yield* runSteps(manager.finalize);

0 commit comments

Comments
 (0)