Use `fff` for workspace search queries #3099
Mergedjuliusmarmingemerged 2 commits into
main fromrefs/pull/3099/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
juliusmarminge changed the title
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
- apps/server/src/workspace/WorkspaceEntries.ts line 147Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +124,21 @@124+125+ const refresh: WorkspaceEntries["Service"]["refresh"] = Effect.fn("WorkspaceEntries.refresh")(126+ function* (cwd) {127+ const normalizedCwd = yield* normalizeWorkspaceRoot(cwd).pipe(128+ Effect.orElseSucceed(() => cwd),129+ );130+ if (!(yield* RcMap.has(workspaceSearchIndexes.rcMap, normalizedCwd))) {131+ return;132+ }133+ yield* Effect.gen(function* () {134+ const searchIndex = yield* WorkspaceSearchIndex.WorkspaceSearchIndex;135+ yield* searchIndex.refresh();136+ }).pipe(137+ Effect.provide(workspaceSearchIndexes.get(normalizedCwd)),138+ Effect.catch((cause) =>139+ Effect.logWarning("Failed to refresh workspace search index", {140+ cwd,141+ cause,142+ }),143+ ),144+ );apps/server/src/workspace/WorkspaceSearchIndex.ts line 183Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +163,21 @@163+ });164+ if (result.ok) return result.value;165+ return yield* new WorkspaceSearchIndexCreateFailed({ cwd, reason: result.error });166+});167+168+const waitForScan = Effect.fn("WorkspaceSearchIndex.waitForScan")(function* (169+ cwd: string,170+ finder: FileFinder,171+) {172+ yield* Effect.sync(() => finder.isScanning()).pipe(173+ Effect.repeat({174+ while: (scanning) => scanning,175+ schedule: Schedule.spaced(WORKSPACE_INDEX_SCAN_POLL_INTERVAL),176+ }),177+ Effect.timeoutOrElse({178+ duration: WORKSPACE_INDEX_SCAN_TIMEOUT,179+ orElse: () =>180+ new WorkspaceSearchIndexScanTimedOut({ cwd, timeout: WORKSPACE_INDEX_SCAN_TIMEOUT }),181+ }),182+ );183+});
juliusmarminge merged thisd12da19
juliusmarminge 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
Run ID:
5aa66450-4ba2-4af5-b42a-da58af1abc66You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands and usage tips.