20210701131549_issue_3579_new_scheduler.rb 539 B

123456789101112131415161718
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue3579NewScheduler < ActiveRecord::Migration[6.0]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. Scheduler.create_if_not_exists(
  6. name: 'Delete old upload cache entries.',
  7. method: 'UploadCacheCleanupJob.perform_now',
  8. period: 1.month,
  9. prio: 2,
  10. active: true,
  11. updated_by_id: 1,
  12. created_by_id: 1,
  13. last_run: Time.zone.now,
  14. )
  15. end
  16. end