Update CleanRemoteNotesProcessorService.ts
This commit is contained in:
parent
fd15a90b77
commit
a7e221ba25
|
@ -58,6 +58,7 @@ export class CleanRemoteNotesProcessorService {
|
|||
},
|
||||
take: 50,
|
||||
order: {
|
||||
// 古い順
|
||||
id: 1,
|
||||
},
|
||||
});
|
||||
|
@ -70,6 +71,10 @@ export class CleanRemoteNotesProcessorService {
|
|||
await this.notesRepository.delete(notes.map(note => note.id));
|
||||
|
||||
for (const note of notes) {
|
||||
if (cursor === null || note.id > cursor) {
|
||||
cursor = note.id;
|
||||
}
|
||||
|
||||
const t = this.idService.parse(note.id).date.getTime();
|
||||
if (stats.oldest === null || t < stats.oldest) {
|
||||
stats.oldest = t;
|
||||
|
@ -79,8 +84,6 @@ export class CleanRemoteNotesProcessorService {
|
|||
}
|
||||
}
|
||||
|
||||
cursor = notes.at(-1)?.id ?? null;
|
||||
|
||||
stats.deletedCount += notes.length;
|
||||
|
||||
const elapsed = Date.now() - startAt;
|
||||
|
|
Loading…
Reference in New Issue