summaryrefslogtreecommitdiff
path: root/src/queue/processors/http/index.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-04-07 16:26:50 +0900
committerGitHub <noreply@github.com>2018-04-07 16:26:50 +0900
commit2547891f940a2872fcfb2b33cd33d4f7a42ca7bc (patch)
tree5cba4ae9cdfd63e7e1ef74a002a7b742183e8d3c /src/queue/processors/http/index.ts
parentMerge pull request #1410 from akihikodaki/objec (diff)
parentRefactor (diff)
downloadmisskey-2547891f940a2872fcfb2b33cd33d4f7a42ca7bc.tar.gz
misskey-2547891f940a2872fcfb2b33cd33d4f7a42ca7bc.tar.bz2
misskey-2547891f940a2872fcfb2b33cd33d4f7a42ca7bc.zip
Merge pull request #1397 from syuilo/refactor
Refactor
Diffstat (limited to 'src/queue/processors/http/index.ts')
-rw-r--r--src/queue/processors/http/index.ts25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/queue/processors/http/index.ts b/src/queue/processors/http/index.ts
index 0ea79305c6..3dc2595374 100644
--- a/src/queue/processors/http/index.ts
+++ b/src/queue/processors/http/index.ts
@@ -1,17 +1,20 @@
-import deliverPost from './deliver-post';
-import follow from './follow';
-import performActivityPub from './perform-activitypub';
+import deliver from './deliver';
import processInbox from './process-inbox';
import reportGitHubFailure from './report-github-failure';
-import unfollow from './unfollow';
const handlers = {
- deliverPost,
- follow,
- performActivityPub,
- processInbox,
- reportGitHubFailure,
- unfollow
+ deliver,
+ processInbox,
+ reportGitHubFailure
};
-export default (job, done) => handlers[job.data.type](job, done);
+export default (job, done) => {
+ const handler = handlers[job.data.type];
+
+ if (handler) {
+ handler(job, done);
+ } else {
+ console.error(`Unknown job: ${job.data.type}`);
+ done();
+ }
+};