Sharkey/src/queue/processors/http/index.ts
2019-02-03 18:16:57 +09:00

19 lines
371 B
TypeScript

import deliver from './deliver';
import processInbox from './process-inbox';
import { queueLogger } from '../..';
const handlers: any = {
deliver,
processInbox,
};
export default (job: any, done: any) => {
const handler = handlers[job.data.type];
if (handler) {
handler(job, done);
} else {
queueLogger.error(`Unknown job: ${job.data.type}`);
done();
}
};