Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 884cef4

Browse files
committed
fix: disable qrc file watcher when rcc.liveExecution.enabled = false
Fix #286
1 parent 3b7e9bf commit 884cef4

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/rcc/rcc-live-execution.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,27 @@ export function registerRccLiveExecution$({
4040
const watcher$ = glob$.pipe(switchMap(glob => getWatcher$(glob)))
4141

4242
return merge(qrcFiles$, watcher$).pipe(
43-
mergeMap(qrcUri =>
44-
registerResourcesLiveExecution$({ extensionUri, qrcUri }),
43+
concatMap(
44+
async qrcUri =>
45+
[
46+
await firstValueFrom(
47+
getLiveExecutionEnabledFromConfig$({
48+
tool: 'rcc',
49+
resource: qrcUri,
50+
}),
51+
),
52+
qrcUri,
53+
] as const,
4554
),
55+
mergeMap(([enabled, qrcUri]) => {
56+
if (!enabled)
57+
return of({
58+
kind: 'Success',
59+
value: 'Live execution disabled',
60+
} as const)
61+
62+
return registerResourcesLiveExecution$({ extensionUri, qrcUri })
63+
}),
4664
)
4765
}
4866

0 commit comments

Comments
 (0)