2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-08-21 04:17:08 -04:00
|
|
|
module Jobs
|
2019-10-02 00:01:53 -04:00
|
|
|
class CleanUpPostReplyKeys < ::Jobs::Scheduled
|
2018-08-21 04:17:08 -04:00
|
|
|
every 1.day
|
|
|
|
|
|
|
|
def execute(_)
|
|
|
|
return if SiteSetting.disallow_reply_by_email_after_days <= 0
|
|
|
|
|
|
|
|
PostReplyKey.where(
|
|
|
|
"created_at < ?",
|
|
|
|
SiteSetting.disallow_reply_by_email_after_days.days.ago
|
|
|
|
).delete_all
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|