mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-27 00:44:38 +02:00
fix(backend): 削除対象ノート検索処理の一部クエリを簡略化 (#17422)
* fix: update related tests * fix CHANGELOG.md * Update CHANGELOG.md Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> --------- Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
@@ -227,10 +227,16 @@ export class CleanRemoteNotesProcessorService {
|
||||
if (currentLimit <= minimumLimit) {
|
||||
job.log('Local note tree complexity is too high, finding next root note...');
|
||||
|
||||
// This query is only used to advance the cursor past the offending range;
|
||||
// it intentionally omits the heavy NOT EXISTS subqueries in `removalCriteria`
|
||||
// (user_note_pining / note_favorite / note_reaction) which would otherwise
|
||||
// hit the same statement_timeout that triggered this fallback path (#17057).
|
||||
// Strict removability is re-evaluated by the next iteration's CTE query.
|
||||
const idWindow = await this.notesRepository.createQueryBuilder('note')
|
||||
.select('id')
|
||||
.where('note.id > :cursorLeft')
|
||||
.andWhere(removalCriteria)
|
||||
.andWhere('note."id" < :newestLimit')
|
||||
.andWhere('note."userHost" IS NOT NULL')
|
||||
.andWhere({ replyId: IsNull(), renoteId: IsNull() })
|
||||
.orderBy('note.id', 'ASC')
|
||||
.limit(minimumLimit + 1)
|
||||
|
||||
Reference in New Issue
Block a user