mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 21:23:08 +02:00
18 lines
330 B
TypeScript
18 lines
330 B
TypeScript
import deliver from './deliver';
|
|
import processInbox from './process-inbox';
|
|
|
|
const handlers: any = {
|
|
deliver,
|
|
processInbox,
|
|
};
|
|
|
|
export default (job: any, done: any) => {
|
|
const handler = handlers[job.data.type];
|
|
|
|
if (handler) {
|
|
handler(job, done);
|
|
} else {
|
|
console.error(`Unknown job: ${job.data.type}`);
|
|
done();
|
|
}
|
|
};
|