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-blocking.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/queue/processors/db/export-blocking.ts') diff --git a/src/queue/processors/db/export-blocking.ts b/src/queue/processors/db/export-blocking.ts index 44025ec960..c4b8c9438d 100644 --- a/src/queue/processors/db/export-blocking.ts +++ b/src/queue/processors/db/export-blocking.ts @@ -33,10 +33,9 @@ export async function exportBlocking(job: Bull.Job, done: any): Promise { const stream = fs.createWriteStream(path, { flags: 'a' }); let exportedCount = 0; - let ended = false; let cursor: any = null; - while (!ended) { + while (true) { const blockings = await Blockings.find({ where: { blockerId: user.id, @@ -49,7 +48,6 @@ export async function exportBlocking(job: Bull.Job, done: any): Promise { }); if (blockings.length === 0) { - ended = true; job.progress(100); break; } -- cgit v1.2.3-freya