Add: #518 コンテンツキャッシュについて、リアクションのあった投稿は削除しないオプション (#535)

* Add: #518 コンテンツキャッシュについて、リアクションのあった投稿は削除しないオプション

* Fix: 新規登録のテストが特定時刻で落ちる問題
This commit is contained in:
KMY(雪あすか) 2024-02-13 08:56:55 +09:00 committed by GitHub
parent ba776d3677
commit f2fb829e63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 118 additions and 5 deletions

View file

@ -32,9 +32,24 @@ class Vacuum::StatusesVacuum
end
def statuses_scope
Status.unscoped.kept
.joins(:account).merge(Account.remote)
.where('statuses.id < ?', retention_period_as_id)
scope = Status.unscoped.kept
.joins(:account).merge(Account.remote)
.where('statuses.id < ?', retention_period_as_id)
if Setting.delete_content_cache_without_reaction
scope = scope.where.not(id: favourited_statuses)
.where.not(id: bookmarked_statuses)
end
scope
end
def favourited_statuses
Favourite.local.select(:status_id)
end
def bookmarked_statuses
Bookmark.select(:status_id)
end
def retention_period_as_id