summaryrefslogtreecommitdiff
path: root/src/queue/processors/db/export-blocking.ts
diff options
context:
space:
mode:
authorAcid Chicken (硫酸鶏) <root@acid-chicken.com>2019-04-14 17:18:17 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-04-14 17:18:17 +0900
commit054220db704a48b5db3066d660a48c09356e916c (patch)
tree066988149192b184e6d4c628e97abdd91395e4d5 /src/queue/processors/db/export-blocking.ts
parentUpdate README.md [AUTOGEN] (#4665) (diff)
downloadsharkey-054220db704a48b5db3066d660a48c09356e916c.tar.gz
sharkey-054220db704a48b5db3066d660a48c09356e916c.tar.bz2
sharkey-054220db704a48b5db3066d660a48c09356e916c.zip
リファクタリング (#4587)
* Use I cap * Avoid _ * Use default value instead of optional boolean * Bye useless variable * Bye verbose try-catch
Diffstat (limited to 'src/queue/processors/db/export-blocking.ts')
-rw-r--r--src/queue/processors/db/export-blocking.ts4
1 files changed, 1 insertions, 3 deletions
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<void> {
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<void> {
});
if (blockings.length === 0) {
- ended = true;
job.progress(100);
break;
}