summaryrefslogtreecommitdiff
path: root/src/queue/processors/http/index.ts
blob: 3dc2595374c1ed56455a4271525aa793ae511ac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import deliver from './deliver';
import processInbox from './process-inbox';
import reportGitHubFailure from './report-github-failure';

const handlers = {
	deliver,
	processInbox,
	reportGitHubFailure
};

export default (job, done) => {
	const handler = handlers[job.data.type];

	if (handler) {
		handler(job, done);
	} else {
		console.error(`Unknown job: ${job.data.type}`);
		done();
	}
};