mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-12-22 10:38:23 +09:00
19 lines
315 B
TypeScript
19 lines
315 B
TypeScript
import deliver from './deliver';
|
|
import processInbox from './process-inbox';
|
|
|
|
const handlers = {
|
|
deliver,
|
|
processInbox,
|
|
};
|
|
|
|
export default (job, done) => {
|
|
const handler = handlers[job.data.type];
|
|
|
|
if (handler) {
|
|
handler(job, done);
|
|
} else {
|
|
console.error(`Unknown job: ${job.data.type}`);
|
|
done();
|
|
}
|
|
};
|