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
1167 });1167 });
1168 1168
1169 // Refresh upstream refs in the background so checkout remains responsive.1169 // Refresh upstream refs in the background so checkout remains responsive.
1170 yield* Effect.sync(() => {1170 yield* Effect.forkScoped(
1171 void Effect.runPromise(1171 refreshCheckedOutBranchUpstream(input.cwd).pipe(Effect.catch(() => Effect.void)),
1172 refreshCheckedOutBranchUpstream(input.cwd).pipe(Effect.catch(() => Effect.void)),1172 );
1173 );
1174 });
1175 });1173 });
1176 1174
1177 const initRepo: GitCoreShape["initRepo"] = (input) =>1175 const initRepo: GitCoreShape["initRepo"] = (input) =>