add get job callback definition

https://github.com/Automattic/kue/blob/master/lib/queue/job.js#L161
This commit is contained in:
amiram
2017-06-18 12:24:40 +03:00
parent ccdd34441d
commit 7b23bb554f
2 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -58,6 +58,7 @@ interface Priorities {
}
export type DoneCallback = (err?: any, result?: any) => void;
export type JobCallback = (err?: any, job?: Job) => void;
export declare class Job extends events.EventEmitter {
public id: number;
@@ -73,7 +74,7 @@ export declare class Job extends events.EventEmitter {
static priorities: Priorities;
static disableSearch: boolean;
static jobEvents: boolean;
static get(id: number, fn: Function): void;
static get(id: number, type: string | JobCallback, fn?: JobCallback): void;
static remove(id: number, fn?: Function): void;
static removeBadJob(id: number): void;
static log(id: number, fn: Function): void;
+7
View File
@@ -39,6 +39,13 @@ function create() {
job.save();
kue.Job.get(job.id, function (err: any, _job: kue.Job) {
console.log('get job', _job);
});
kue.Job.get(job.id, 'video conversion', function (err: any, _job: kue.Job) {
console.log('get job', _job);
});
setTimeout( create, Math.random() * 2000 | 0 );
}