Update CleanRemoteNotesProcessorService.ts

This commit is contained in:
syuilo 2025-07-17 09:52:44 +09:00
parent fd15a90b77
commit a7e221ba25
1 changed files with 5 additions and 2 deletions

View File

@ -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;