From 25ed141c7c7631ef21d8764c1163fbf8a6591391 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Nov 2017 11:31:15 +0100 Subject: Put activity pub sends inside transactions --- server/controllers/api/videos/rate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index 0c6a988cf..c27c61116 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts @@ -58,11 +58,11 @@ async function rateVideo (req: express.Request, res: express.Response) { else if (previousRate.type === VIDEO_RATE_TYPES.DISLIKE) dislikesToIncrement-- if (rateType === 'none') { // Destroy previous rate - await previousRate.destroy() + await previousRate.destroy({ transaction: t }) } else { // Update previous rate previousRate.type = rateType - await previousRate.save() + await previousRate.save({ transaction: t }) } } else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate const query = { -- cgit v1.2.3