History

Simplify runtime task execution flow in task runner

Rhys Sullivan committed 8 months ago

Commit 91ec1fe1 parent 6c01f0b1 file · +12 −14Browse files

Unified · Split

executor/packages/database/src/runtime/task_runner.ts+12−14
@@ -144,21 +144,19 @@ export async function runQueuedTask( · 143 unmodified lines
144144 };
145145 }
146146
147− const runtimeResult = await (async () => {
148− const adapter = new InProcessExecutionAdapter({
149− runId: args.taskId,
150− invokeTool: async (call) => await invokeTool(ctx, running, call),
151− });
147+ const adapter = new InProcessExecutionAdapter({
148+ runId: args.taskId,
149+ invokeTool: async (call) => await invokeTool(ctx, running, call),
150+ });
152151
153− return await runCodeWithAdapter(
154− {
155− taskId: args.taskId,
156− code: running.code,
157− timeoutMs: running.timeoutMs,
158− },
159− adapter,
160− );
161− })();
152+ const runtimeResult = await runCodeWithAdapter(
153+ {
154+ taskId: args.taskId,
155+ code: running.code,
156+ timeoutMs: running.timeoutMs,
157+ },
158+ adapter,
159+ );
162160
163161 const finished = await markTaskFinished(ctx, {
164162 taskId: args.taskId,