diff options
Diffstat (limited to 'server/models/job')
-rw-r--r-- | server/models/job/job-interface.ts | 6 | ||||
-rw-r--r-- | server/models/job/job.ts | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/server/models/job/job-interface.ts b/server/models/job/job-interface.ts index ab6678257..31b377367 100644 --- a/server/models/job/job-interface.ts +++ b/server/models/job/job-interface.ts | |||
@@ -1,8 +1,10 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | 2 | ||
3 | import { JobState } from '../../../shared/models/job.model' | ||
4 | |||
3 | export namespace JobMethods { | 5 | export namespace JobMethods { |
4 | export type ListWithLimitCallback = (err: Error, jobInstances: JobInstance[]) => void | 6 | export type ListWithLimitCallback = (err: Error, jobInstances: JobInstance[]) => void |
5 | export type ListWithLimit = (limit: number, state: string, callback: ListWithLimitCallback) => void | 7 | export type ListWithLimit = (limit: number, state: JobState, callback: ListWithLimitCallback) => void |
6 | } | 8 | } |
7 | 9 | ||
8 | export interface JobClass { | 10 | export interface JobClass { |
@@ -10,7 +12,7 @@ export interface JobClass { | |||
10 | } | 12 | } |
11 | 13 | ||
12 | export interface JobAttributes { | 14 | export interface JobAttributes { |
13 | state: string | 15 | state: JobState |
14 | handlerName: string | 16 | handlerName: string |
15 | handlerInputData: object | 17 | handlerInputData: object |
16 | } | 18 | } |
diff --git a/server/models/job/job.ts b/server/models/job/job.ts index 60a6c551b..38e4e8f30 100644 --- a/server/models/job/job.ts +++ b/server/models/job/job.ts | |||
@@ -11,6 +11,7 @@ import { | |||
11 | 11 | ||
12 | JobMethods | 12 | JobMethods |
13 | } from './job-interface' | 13 | } from './job-interface' |
14 | import { JobState } from '../../../shared/models/job.model' | ||
14 | 15 | ||
15 | let Job: Sequelize.Model<JobInstance, JobAttributes> | 16 | let Job: Sequelize.Model<JobInstance, JobAttributes> |
16 | let listWithLimit: JobMethods.ListWithLimit | 17 | let listWithLimit: JobMethods.ListWithLimit |
@@ -48,7 +49,7 @@ export default function defineJob (sequelize: Sequelize.Sequelize, DataTypes: Se | |||
48 | 49 | ||
49 | // --------------------------------------------------------------------------- | 50 | // --------------------------------------------------------------------------- |
50 | 51 | ||
51 | listWithLimit = function (limit: number, state: string, callback: JobMethods.ListWithLimitCallback) { | 52 | listWithLimit = function (limit: number, state: JobState, callback: JobMethods.ListWithLimitCallback) { |
52 | const query = { | 53 | const query = { |
53 | order: [ | 54 | order: [ |
54 | [ 'id', 'ASC' ] | 55 | [ 'id', 'ASC' ] |