リファクタリング (#4587)

* Use I cap

* Avoid _

* Use default value instead of optional boolean

* Bye useless variable

* Bye verbose try-catch
This commit is contained in:
Acid Chicken (硫酸鶏) 2019-04-14 17:18:17 +09:00 committed by syuilo
parent 97bff010a8
commit 054220db70
8 changed files with 17 additions and 37 deletions

View file

@ -46,10 +46,9 @@ export async function exportNotes(job: Bull.Job, done: any): Promise<void> {
});
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<void> {
});
if (notes.length === 0) {
ended = true;
job.progress(100);
break;
}