]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/job/job-interface.ts
Follow works
[github/Chocobozzz/PeerTube.git] / server / models / job / job-interface.ts
index 31b3773670d0eab841efee7c2c4c30d13202f105..411a05029e56fa2fe7e95da66f362177180a7594 100644 (file)
@@ -1,20 +1,20 @@
 import * as Sequelize from 'sequelize'
+import * as Promise from 'bluebird'
 
-import { JobState } from '../../../shared/models/job.model'
+import { JobCategory, JobState } from '../../../shared/models/job.model'
 
 export namespace JobMethods {
-  export type ListWithLimitCallback = (err: Error, jobInstances: JobInstance[]) => void
-  export type ListWithLimit = (limit: number, state: JobState, callback: ListWithLimitCallback) => void
+  export type ListWithLimitByCategory = (limit: number, state: JobState, category: JobCategory) => Promise<JobInstance[]>
 }
 
 export interface JobClass {
-  listWithLimit: JobMethods.ListWithLimit
+  listWithLimitByCategory: JobMethods.ListWithLimitByCategory
 }
 
 export interface JobAttributes {
   state: JobState
   handlerName: string
-  handlerInputData: object
+  handlerInputData: any
 }
 
 export interface JobInstance extends JobClass, JobAttributes, Sequelize.Instance<JobAttributes> {