20200507095900_imap_authentication_migration_cleanup_job_scheduler.rb 535 B

123456789101112131415161718
  1. class ImapAuthenticationMigrationCleanupJobScheduler < ActiveRecord::Migration[5.2]
  2. def change
  3. # return if it's a new setup
  4. return if !Setting.exists?(name: 'system_init_done')
  5. Scheduler.create_or_update(
  6. name: 'Delete obsolete classic IMAP backup.',
  7. method: 'ImapAuthenticationMigrationCleanupJob.perform_now',
  8. period: 1.day,
  9. last_run: Time.zone.now,
  10. prio: 2,
  11. active: true,
  12. updated_by_id: 1,
  13. created_by_id: 1,
  14. )
  15. end
  16. end