From a8e13eac3ad0188bac0506d6a9a01f4e3a4524de Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 6 Nov 2018 14:23:49 +0100 Subject: [PATCH] fix postponed deletion job - need to have cls --- src/services/notes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/notes.js b/src/services/notes.js index ce55890ba..5745de7b7 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -5,6 +5,7 @@ const syncTableService = require('./sync_table'); const attributeService = require('./attributes'); const eventService = require('./events'); const repository = require('./repository'); +const cls = require('../services/cls'); const Note = require('../entities/note'); const NoteImage = require('../entities/note_image'); const NoteRevision = require('../entities/note_revision'); @@ -322,9 +323,9 @@ async function cleanupDeletedNotes() { } // first cleanup kickoff 5 minutes after startup -setTimeout(cleanupDeletedNotes, 5 * 60 * 1000); +setTimeout(cls.wrap(cleanupDeletedNotes), 5 * 60 * 1000); -setInterval(cleanupDeletedNotes, 4 * 3600 * 1000); +setInterval(cls.wrap(cleanupDeletedNotes), 4 * 3600 * 1000); module.exports = { createNewNote,