trabajo-afectivo/db/migrate/20200507095900_imap_authentication_migration_cleanup_job_scheduler.rb

21 lines
611 B
Ruby

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
class ImapAuthenticationMigrationCleanupJobScheduler < ActiveRecord::Migration[5.2]
def change
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
Scheduler.create_or_update(
name: 'Delete obsolete classic IMAP backup.',
method: 'ImapAuthenticationMigrationCleanupJob.perform_now',
period: 1.day,
last_run: Time.zone.now,
prio: 2,
active: true,
updated_by_id: 1,
created_by_id: 1,
)
end
end