Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot] 2026-04-24 23:05:03 +00:00
parent 7701011bc7
commit 74f7a69991
6 changed files with 13 additions and 9 deletions

View file

@ -315,7 +315,8 @@ function jsonResponse(status: number, body: unknown) {
}
async function failJob(
supabase: ReturnType<typeof createClient>,
// deno-lint-ignore no-explicit-any
supabase: any,
agent: { id: string },
jobId: string | null,
message: string,
@ -330,7 +331,8 @@ async function failJob(
}
async function scheduleRetry(
supabase: ReturnType<typeof createClient>,
// deno-lint-ignore no-explicit-any
supabase: any,
agent: { id: string },
jobId: string,
message: string,
@ -341,8 +343,8 @@ async function scheduleRetry(
.eq("id", jobId)
.single();
const attempt = job?.attempt ?? 1;
const max = job?.max_attempts ?? 5;
const attempt: number = (job?.attempt as number | undefined) ?? 1;
const max: number = (job?.max_attempts as number | undefined) ?? 5;
if (attempt >= max) {
await failJob(supabase, agent, jobId, `Max attempts reached. Last error: ${message}`);