mirror of
https://github.com/discourse/discourse.git
synced 2025-03-03 20:13:27 +08:00
13 lines
311 B
Ruby
13 lines
311 B
Ruby
![]() |
module Jobs
|
||
|
class CleanUpDrafts < Jobs::Scheduled
|
||
|
every 1.week
|
||
|
|
||
|
def execute(args)
|
||
|
delete_drafts_older_than_n_days = SiteSetting.delete_drafts_older_than_n_days.days.ago
|
||
|
|
||
|
# remove old drafts
|
||
|
Draft.where("updated_at < ?", delete_drafts_older_than_n_days).destroy_all
|
||
|
end
|
||
|
end
|
||
|
end
|