]>
Commit | Line | Data |
---|---|---|
94a5ff8a C |
1 | import { JobState } from '../../../shared/models' |
2 | import { exists } from './misc' | |
1061c73f | 3 | import { jobTypes } from '@server/lib/job-queue/job-queue' |
94a5ff8a | 4 | |
402145b8 | 5 | const jobStates: JobState[] = [ 'active', 'completed', 'failed', 'waiting', 'delayed', 'paused' ] |
94a5ff8a C |
6 | |
7 | function isValidJobState (value: JobState) { | |
1061c73f C |
8 | return exists(value) && jobStates.includes(value) |
9 | } | |
10 | ||
11 | function isValidJobType (value: any) { | |
12 | return exists(value) && jobTypes.includes(value) | |
94a5ff8a C |
13 | } |
14 | ||
15 | // --------------------------------------------------------------------------- | |
16 | ||
17 | export { | |
040d6896 | 18 | jobStates, |
1061c73f C |
19 | isValidJobState, |
20 | isValidJobType | |
94a5ff8a | 21 | } |