Skip to content

Commit 940389f

Browse files
chore(lint): enforce raceFirstWithSleepToTimeout
1 parent 64e70c6 commit 940389f

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/ClaudeTaskOutputTail.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,12 @@ export const tailClaudeTaskOutput = Effect.fn("ClaudeTaskOutputTail.tail")(funct
5656
readonly onChunk: (chunk: string) => Effect.Effect<void>;
5757
}) {
5858
const fileSystem = yield* FileSystem.FileSystem;
59-
const pause = Effect.raceFirst(
60-
Effect.sleep(CLAUDE_TASK_OUTPUT_POLL_MS).pipe(Effect.as(false)),
61-
Deferred.await(input.stop).pipe(Effect.as(true)),
59+
const pause = Deferred.await(input.stop).pipe(
60+
Effect.as(true),
61+
Effect.timeoutOrElse({
62+
duration: CLAUDE_TASK_OUTPUT_POLL_MS,
63+
orElse: () => Effect.succeed(false),
64+
}),
6265
);
6366
let file = Option.none<string>();
6467
for (let attempt = 0; Option.isNone(file); attempt += 1) {

‎tsconfig.base.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"namespaceImportPackages": ["@effect/platform-node", "effect"],
2525
"effectFn": ["span", "inferred-span", "suggested-span"],
2626
"diagnosticSeverity": {
27+
"raceFirstWithSleepToTimeout": "error",
2728
"redundantMapError": "error",
2829
"provideLayerSucceedToProvideService": "error",
2930
"flatMapIgnoredParamToAndThen": "error",

0 commit comments

Comments
 (0)