Merge pull request #177 from akhill10/feat/isRetry-on-context-run

feat: added isRetry in context.run
This commit is contained in:
Eric Allam
2023-07-17 11:48:33 +01:00
committed by GitHub
6 changed files with 13 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
added isRetry in context run
@@ -70,6 +70,7 @@ export class ContinueRunService {
status: "PENDING",
reason: "EXECUTE_JOB",
retryLimit: EXECUTE_JOB_RETRY_LIMIT,
isRetry: true,
},
});
@@ -193,7 +193,7 @@ export class PerformRunExecutionService {
}
}
async #executeJob(execution: FoundRunExecution) {
const { run } = execution;
const { run, isRetry } = execution;
if (run.status === "CANCELED") {
await this.#cancelExecution(execution);
@@ -264,6 +264,7 @@ export class PerformRunExecutionService {
id: run.id,
isTest: run.isTest,
startedAt,
isRetry,
},
environment: {
id: run.environment.id,
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "JobRunExecution" ADD COLUMN "isRetry" BOOLEAN NOT NULL DEFAULT false;
+2
View File
@@ -737,6 +737,8 @@ model JobRunExecution {
resumeTaskId String?
graphileJobId String?
isRetry Boolean @default(false)
}
enum JobRunExecutionReason {
+1
View File
@@ -307,6 +307,7 @@ export const RunJobBodySchema = z.object({
run: z.object({
id: z.string(),
isTest: z.boolean(),
isRetry: z.boolean(),
startedAt: z.coerce.date(),
}),
environment: z.object({