Skip to content

Commit 8e9b126

Browse files
Boris Dorofeevnodkz
authored andcommitted
fix: add unknown state job
1 parent c251f2f commit 8e9b126

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/types/job/Job.state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function createStateFC(
1010
return {
1111
type: getJobStatusEnumTC(sc, opts),
1212
resolve: async (job: Job) => {
13-
return job.getState();
13+
return await job.getState();
1414
},
1515
};
1616
}

src/types/scalars/JobStatusEnum.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export enum JobStatusEnum {
88
DELAYED = 'delayed',
99
FAILED = 'failed',
1010
PAUSED = 'paused',
11+
UNKNOWN = 'unknown',
1112
}
1213

1314
export function getJobStatusEnumTC(sc: SchemaComposer<any>, opts: Options) {
@@ -20,6 +21,7 @@ export function getJobStatusEnumTC(sc: SchemaComposer<any>, opts: Options) {
2021
DELAYED: { value: JobStatusEnum.DELAYED },
2122
FAILED: { value: JobStatusEnum.FAILED },
2223
PAUSED: { value: JobStatusEnum.PAUSED }, //TODO: в bull написано что устарело, теперь все waiting
24+
UNKNOWN: { value: JobStatusEnum.UNKNOWN },
2325
});
2426
});
2527
}

0 commit comments

Comments
 (0)