summaryrefslogtreecommitdiff
path: root/src/queue/processors/db
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-04-05 01:05:50 +0900
committerGitHub <noreply@github.com>2018-04-05 01:05:50 +0900
commit87d592c9c46e252edfd44d98f3ca1ec981c1e86f (patch)
tree78800c67f3238c0fa506c22b8473ba7a8705e77c /src/queue/processors/db
parentMerge pull request #1394 from akihikodaki/duplicate (diff)
parentLet unhandled rejection handler handle rejections in jobs (diff)
downloadmisskey-87d592c9c46e252edfd44d98f3ca1ec981c1e86f.tar.gz
misskey-87d592c9c46e252edfd44d98f3ca1ec981c1e86f.tar.bz2
misskey-87d592c9c46e252edfd44d98f3ca1ec981c1e86f.zip
Merge pull request #1395 from akihikodaki/duplicate
Let unhandled rejection handler handle rejections in jobs
Diffstat (limited to 'src/queue/processors/db')
-rw-r--r--src/queue/processors/db/delete-post-dependents.ts4
-rw-r--r--src/queue/processors/db/index.ts2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/queue/processors/db/delete-post-dependents.ts b/src/queue/processors/db/delete-post-dependents.ts
index 6de21eb053..fb6617e952 100644
--- a/src/queue/processors/db/delete-post-dependents.ts
+++ b/src/queue/processors/db/delete-post-dependents.ts
@@ -5,7 +5,7 @@ import PostReaction from '../../../models/post-reaction';
import PostWatching from '../../../models/post-watching';
import Post from '../../../models/post';
-export default async ({ data }) => Promise.all([
+export default ({ data }, done) => Promise.all([
Favorite.remove({ postId: data._id }),
Notification.remove({ postId: data._id }),
PollVote.remove({ postId: data._id }),
@@ -19,4 +19,4 @@ export default async ({ data }) => Promise.all([
}),
Post.remove({ repostId: data._id })
]))
-]);
+]).then(() => done(), done);
diff --git a/src/queue/processors/db/index.ts b/src/queue/processors/db/index.ts
index 75838c099b..468ec442ac 100644
--- a/src/queue/processors/db/index.ts
+++ b/src/queue/processors/db/index.ts
@@ -4,4 +4,4 @@ const handlers = {
deletePostDependents
};
-export default (job, done) => handlers[job.data.type](job).then(() => done(), done);
+export default (job, done) => handlers[job.data.type](job, done);