リファクタリング (#4587)
* Use I cap * Avoid _ * Use default value instead of optional boolean * Bye useless variable * Bye verbose try-catch
This commit is contained in:
parent
97bff010a8
commit
054220db70
8 changed files with 17 additions and 37 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue