Skip to content

Commit 19d0f28

Browse files
committed
fix: use configurable timeout for Redis key expiration in registerRunner
- Updated registerRunner function to accept timeoutSeconds parameter - Modified call in runTask.ts to pass configurable timeout instead of hardcoded EVALS_TIMEOUT - Removed unused EVALS_TIMEOUT import from redis.ts - Ensures Redis keys remain valid for the entire duration of task execution (up to 10 minutes)
1 parent e421de7 commit 19d0f28

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

packages/evals/src/cli/redis.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { createClient, type RedisClientType } from "redis"
22

3-
import { EVALS_TIMEOUT } from "@roo-code/types"
4-
53
let redis: RedisClientType | undefined
64

75
export const redisClient = async () => {
@@ -18,11 +16,19 @@ export const getPubSubKey = (runId: number) => `evals:${runId}`
1816
export const getRunnersKey = (runId: number) => `runners:${runId}`
1917
export const getHeartbeatKey = (runId: number) => `heartbeat:${runId}`
2018

21-
export const registerRunner = async ({ runId, taskId }: { runId: number; taskId: number }) => {
19+
export const registerRunner = async ({
20+
runId,
21+
taskId,
22+
timeoutSeconds,
23+
}: {
24+
runId: number
25+
taskId: number
26+
timeoutSeconds: number
27+
}) => {
2228
const redis = await redisClient()
2329
const runnersKey = getRunnersKey(runId)
2430
await redis.sAdd(runnersKey, `task-${taskId}:${process.env.HOSTNAME ?? process.pid}`)
25-
await redis.expire(runnersKey, EVALS_TIMEOUT / 1_000)
31+
await redis.expire(runnersKey, timeoutSeconds)
2632
}
2733

2834
export const deregisterRunner = async ({ runId, taskId }: { runId: number; taskId: number }) => {

packages/evals/src/cli/runTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const processTask = async ({ taskId, logger }: { taskId: number; logger?:
3535
const task = await findTask(taskId)
3636
const { language, exercise } = task
3737
const run = await findRun(task.runId)
38-
await registerRunner({ runId: run.id, taskId })
38+
await registerRunner({ runId: run.id, taskId, timeoutSeconds: (run.timeout || 5) * 60 })
3939

4040
const containerized = isDockerContainer()
4141

0 commit comments

Comments
 (0)