summaryrefslogtreecommitdiff
path: root/src/queue/processors/index.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2019-02-05 19:50:14 +0900
committerGitHub <noreply@github.com>2019-02-05 19:50:14 +0900
commit5db5bbd1cd25f83640d4dd01de14e7774d9370db (patch)
tree701c27744ca0e4d6e16d5f2fb568481c1bf4baf0 /src/queue/processors/index.ts
parentAdd ffmpeg package for the runner container (#4145) (diff)
downloadsharkey-5db5bbd1cd25f83640d4dd01de14e7774d9370db.tar.gz
sharkey-5db5bbd1cd25f83640d4dd01de14e7774d9370db.tar.bz2
sharkey-5db5bbd1cd25f83640d4dd01de14e7774d9370db.zip
自分の投稿情報をエクスポートできるように (#4144)
* wip * 正しいJSONを生成するように * データを整形
Diffstat (limited to 'src/queue/processors/index.ts')
-rw-r--r--src/queue/processors/index.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/queue/processors/index.ts b/src/queue/processors/index.ts
new file mode 100644
index 0000000000..3f08fe29fb
--- /dev/null
+++ b/src/queue/processors/index.ts
@@ -0,0 +1,21 @@
+import deliver from './http/deliver';
+import processInbox from './http/process-inbox';
+import { exportNotes } from './export-notes';
+import { queueLogger } from '../logger';
+
+const handlers: any = {
+ deliver,
+ processInbox,
+ exportNotes,
+};
+
+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();
+ }
+};