Merge pull request #177 from akhill10/feat/isRetry-on-context-run
feat: added isRetry in context.run
This commit is contained in:
@@ -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,
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "JobRunExecution" ADD COLUMN "isRetry" BOOLEAN NOT NULL DEFAULT false;
|
||||
@@ -737,6 +737,8 @@ model JobRunExecution {
|
||||
resumeTaskId String?
|
||||
|
||||
graphileJobId String?
|
||||
|
||||
isRetry Boolean @default(false)
|
||||
}
|
||||
|
||||
enum JobRunExecutionReason {
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user