20200507095900_imap_authentication_migration_cleanup_job_scheduler.rb 612 B

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