2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2020-05-28 13:28:07 +00:00
|
|
|
class ImapAuthenticationMigrationCleanupJobScheduler < ActiveRecord::Migration[5.2]
|
|
|
|
def change
|
|
|
|
|
|
|
|
# return if it's a new setup
|
2020-08-03 08:35:43 +00:00
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
2020-05-28 13:28:07 +00:00
|
|
|
|
|
|
|
Scheduler.create_or_update(
|
|
|
|
name: 'Delete obsolete classic IMAP backup.',
|
|
|
|
method: 'ImapAuthenticationMigrationCleanupJob.perform_now',
|
|
|
|
period: 1.day,
|
2020-06-08 07:58:57 +00:00
|
|
|
last_run: Time.zone.now,
|
2020-05-28 13:28:07 +00:00
|
|
|
prio: 2,
|
|
|
|
active: true,
|
|
|
|
updated_by_id: 1,
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|