fix(ReindexNotesProcessor): total only needs to be get once
All checks were successful
Publish Docker Image (Misskey) TeamCity build finished
All checks were successful
Publish Docker Image (Misskey) TeamCity build finished
This commit is contained in:
parent
8af17dc0cd
commit
10cc5cd361
@ -40,6 +40,9 @@ export class ReindexNotesProcessorService {
|
||||
order: { id: 'DESC' },
|
||||
take: 1,
|
||||
}))[0];
|
||||
const total = await this.notesRepository.countBy({
|
||||
id: LessThanOrEqual(lastNote.id),
|
||||
});
|
||||
let indexedCount = 0;
|
||||
let cursor: MiNote['id'] | null = null;
|
||||
|
||||
@ -66,10 +69,6 @@ export class ReindexNotesProcessorService {
|
||||
|
||||
indexedCount += 20;
|
||||
|
||||
const total = await this.notesRepository.countBy({
|
||||
id: LessThanOrEqual(lastNote.id),
|
||||
});
|
||||
|
||||
await job.updateProgress(100 / total * indexedCount);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user