History

Scope upstream refresh in checkout effect lifecycle

- Replace fire-and-forget `Effect.runPromise` call with `Effect.forkScoped` - Keep checkout responsive while tying upstream refresh to scoped effect management

Julius Marminge committed 8 months ago

Commit c91b79b1 parent 5e55aa31 file · +3 −5Browse files

Unified · Split

apps/server/src/git/Layers/GitCore.ts+3−5
@@ -1167,11 +1167,9 @@ const makeGitCore = Effect.gen(function* () { · 1166 unmodified lines
11671167 });
11681168
11691169 // Refresh upstream refs in the background so checkout remains responsive.
1170− yield* Effect.sync(() => {
1171− void Effect.runPromise(
1172− refreshCheckedOutBranchUpstream(input.cwd).pipe(Effect.catch(() => Effect.void)),
1173− );
1174− });
1170+ yield* Effect.forkScoped(
1171+ refreshCheckedOutBranchUpstream(input.cwd).pipe(Effect.catch(() => Effect.void)),
1172+ );
11751173 });
11761174
11771175 const initRepo: GitCoreShape["initRepo"] = (input) =>