mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 17:47:40 +00:00
perf(watchers): skip startup for canceled runtime requests (#35556)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -256,6 +256,9 @@ export async function watchFileExplorerInWatcherProcess(
|
||||
onTerminalError: (error: Error) => void = () => undefined,
|
||||
signal?: AbortSignal
|
||||
): Promise<() => Promise<void>> {
|
||||
if (signal?.aborted) {
|
||||
throw createRuntimeRootAbortError()
|
||||
}
|
||||
const existingRoot = runtimeRootWatches.get(rootPath)
|
||||
if (existingRoot?.closed) {
|
||||
if (!existingRoot.closePromise) {
|
||||
@@ -263,9 +266,6 @@ export async function watchFileExplorerInWatcherProcess(
|
||||
}
|
||||
// Join the prior generation's physical release before reusing its native root.
|
||||
await existingRoot.closePromise
|
||||
if (signal?.aborted) {
|
||||
throw createRuntimeRootAbortError()
|
||||
}
|
||||
return watchFileExplorerInWatcherProcess(rootPath, callback, onTerminalError, signal)
|
||||
}
|
||||
const root = existingRoot ?? createRuntimeRootWatch(rootPath)
|
||||
|
||||
Reference in New Issue
Block a user