mirror of
https://github.com/mastodon/mastodon.git
synced 2026-06-02 21:46:55 -05:00
17 lines
367 B
Ruby
17 lines
367 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Scheduler::CollectionItemCleanupScheduler
|
|
include Sidekiq::Worker
|
|
|
|
RETENTION_PERIOD = 24.hours
|
|
|
|
sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 1.day.to_i
|
|
|
|
def perform
|
|
CollectionItem
|
|
.where(state: [:rejected, :revoked])
|
|
.where(updated_at: ...(RETENTION_PERIOD.ago))
|
|
.destroy_all
|
|
end
|
|
end
|