fix(server): avoid slow checkpoint index rebuilds #8538
ClosedRadu028(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/8538/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- apps/server/src/vcs/GitVcsDriver.ts line 753OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -731,10 +741,13 @@741+ .pipe(742+ Effect.ignore,743+ Effect.andThen(744+ fileSystem.remove(`${tempIndexPath}.lock`, { force: true }).pipe(Effect.ignore),745+ ),746+ );731747732748 yield* Effect.gen(function* () {733- const headExists = yield* hasHeadCommit(input.cwd);734- if (headExists) {735- yield* execute({736- operation,737- cwd: input.cwd,738- args: ["read-tree", "HEAD"],739- env: commitEnv,740- });749+ const currentIndexPath = yield* resolveGitIndexPath(input.cwd);750+ const copiedCurrentIndex = yield* fileSystem.exists(currentIndexPath).pipe(751+ Effect.flatMap((exists) =>752+ exists753+ ? fileSystem.copyFile(currentIndexPath, tempIndexPath).pipe(Effect.as(true))
- apps/server/src/vcs/GitVcsDriver.ts line 839Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -739,2 +749,19 @@739- env: commitEnv,740- });749+ const currentIndexPath = yield* resolveGitIndexPath(input.cwd);750+ const copiedCurrentIndex = yield* fileSystem.exists(currentIndexPath).pipe(751+ Effect.flatMap((exists) =>752+ exists753+ ? fileSystem.copyFile(currentIndexPath, tempIndexPath).pipe(Effect.as(true))754+ : Effect.succeed(false),755+ ),756+ Effect.orElseSucceed(() => false),757+ );758+ if (!copiedCurrentIndex) {759+ const headExists = yield* hasHeadCommit(input.cwd);760+ if (headExists) {761+ yield* execute({762+ operation,763+ cwd: input.cwd,764+ args: ["read-tree", "HEAD"],765+ env: commitEnv,766+ });767+ }
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Radu028(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
56f87639-74b8-43d4-b542-7f7f09009f8cYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Comment `@coderabbitai help` to get the list of available commands.