2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00
discourse/app/jobs/scheduled/clean_up_unmatched_emails.rb
2017-07-28 10:20:09 +09:00

16 lines
346 B
Ruby

module Jobs
class CleanUpUnmatchedEmails < Jobs::Scheduled
every 1.day
def execute(args)
last_match_threshold = SiteSetting.max_age_unmatched_emails.days.ago
ScreenedEmail.where(action_type: ScreenedEmail.actions[:block])
.where("last_match_at < ?", last_match_threshold)
.destroy_all
end
end
end