mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 21:33:10 +02:00
0868c3517f
Resolve #4104 Resolve #1966 Resolve #1937
19 lines
371 B
TypeScript
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();
|
|
}
|
|
};
|