discourse/app/jobs/scheduled/purge_expired_ignored_users.rb
David Taylor bacf7966fe
FIX: Remove 4 month limit on IgnoredUser records (#11105)
b8c676e7 added the 'forever' option to the UI, and this is correctly stored in the database. However, we had a hard-coded limit of 4 months in the cleanup job. This commit removes the limit, so ignores can last forever.
2020-11-03 12:31:13 +00:00

13 lines
315 B
Ruby

# frozen_string_literal: true
module Jobs
class PurgeExpiredIgnoredUsers < ::Jobs::Scheduled
every 1.day
def execute(args)
IgnoredUser.where("expiring_at <= ?", Time.zone.now).delete_all
IgnoredUser.where("created_at <= ? AND expiring_at IS NULL", 4.months.ago).delete_all
end
end
end