diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2021-02-13 15:33:38 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2021-02-13 15:33:38 +0900 |
| commit | 91172654e4b715198099146d4c442e0787df0785 (patch) | |
| tree | d6cc5de1c3be9e143c76c05fffe7d2f07fc376c8 /src/queue/processors | |
| parent | wip: email notification (diff) | |
| download | sharkey-91172654e4b715198099146d4c442e0787df0785.tar.gz sharkey-91172654e4b715198099146d4c442e0787df0785.tar.bz2 sharkey-91172654e4b715198099146d4c442e0787df0785.zip | |
refactor: resolve #7139
Diffstat (limited to 'src/queue/processors')
| -rw-r--r-- | src/queue/processors/db/export-notes.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/queue/processors/db/export-notes.ts b/src/queue/processors/db/export-notes.ts index 0fd8c02c4a..f76a47aacd 100644 --- a/src/queue/processors/db/export-notes.ts +++ b/src/queue/processors/db/export-notes.ts @@ -9,7 +9,6 @@ import { Users, Notes, Polls } from '../../../models'; import { MoreThan } from 'typeorm'; import { Note } from '../../../models/entities/note'; import { Poll } from '../../../models/entities/poll'; -import { ensure } from '../../../prelude/ensure'; const logger = queueLogger.createSubLogger('export-notes'); @@ -70,7 +69,7 @@ export async function exportNotes(job: Bull.Job, done: any): Promise<void> { for (const note of notes) { let poll: Poll | undefined; if (note.hasPoll) { - poll = await Polls.findOne({ noteId: note.id }).then(ensure); + poll = await Polls.findOneOrFail({ noteId: note.id }); } const content = JSON.stringify(serialize(note, poll)); await new Promise((res, rej) => { |