From 054220db704a48b5db3066d660a48c09356e916c Mon Sep 17 00:00:00 2001 From: "Acid Chicken (硫酸鶏)" Date: Sun, 14 Apr 2019 17:18:17 +0900 Subject: リファクタリング (#4587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use I cap * Avoid _ * Use default value instead of optional boolean * Bye useless variable * Bye verbose try-catch --- src/queue/processors/db/export-notes.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/queue/processors/db/export-notes.ts') diff --git a/src/queue/processors/db/export-notes.ts b/src/queue/processors/db/export-notes.ts index eaa5caf63f..d03a216a59 100644 --- a/src/queue/processors/db/export-notes.ts +++ b/src/queue/processors/db/export-notes.ts @@ -46,10 +46,9 @@ export async function exportNotes(job: Bull.Job, done: any): Promise { }); let exportedNotesCount = 0; - let ended = false; let cursor: any = null; - while (!ended) { + while (true) { const notes = await Notes.find({ where: { userId: user.id, @@ -62,7 +61,6 @@ export async function exportNotes(job: Bull.Job, done: any): Promise { }); if (notes.length === 0) { - ended = true; job.progress(100); break; } -- cgit v1.2.3-freya