From d63090e67e3dc8e6502ec3e97418e2d7e1e1a7de Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Thu, 27 Jan 2022 15:21:35 +0100 Subject: [PATCH] Maintenance: Fixed wording of scheduler job. --- .../20220127135317_scheduler_updates2.rb | 26 +++++++++++++++++++ db/seeds/schedulers.rb | 2 +- i18n/zammad.pot | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20220127135317_scheduler_updates2.rb diff --git a/db/migrate/20220127135317_scheduler_updates2.rb b/db/migrate/20220127135317_scheduler_updates2.rb new file mode 100644 index 000000000..f96886b6a --- /dev/null +++ b/db/migrate/20220127135317_scheduler_updates2.rb @@ -0,0 +1,26 @@ +# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/ + +class SchedulerUpdates2 < ActiveRecord::Migration[6.0] + def change + return if !Setting.exists?(name: 'system_init_done') + + schedulers_update = [ + { + name: "Clean up 'Cti::Log'.", + method: 'Cti::Log.cleanup', + }, + ] + + schedulers_update.each do |scheduler| + fetched_scheduler = Scheduler.find_by(method: scheduler[:method]) + next if !fetched_scheduler + + if scheduler[:name] + # p "Updating name of #{scheduler[:name]} to #{scheduler[:name]}" + fetched_scheduler.name = scheduler[:name] + end + + fetched_scheduler.save! + end + end +end diff --git a/db/seeds/schedulers.rb b/db/seeds/schedulers.rb index 6a8af0380..ac6b852b5 100644 --- a/db/seeds/schedulers.rb +++ b/db/seeds/schedulers.rb @@ -175,7 +175,7 @@ Scheduler.create_if_not_exists( created_by_id: 1, ) Scheduler.create_if_not_exists( - name: __("Clean up 'Cti::Log.'"), + name: __("Clean up 'Cti::Log'."), method: 'Cti::Log.cleanup', period: 1.month, prio: 2, diff --git a/i18n/zammad.pot b/i18n/zammad.pot index bcb61a1b8..5be6ca3dc 100644 --- a/i18n/zammad.pot +++ b/i18n/zammad.pot @@ -1671,7 +1671,7 @@ msgid "City" msgstr "" #: db/seeds/schedulers.rb -msgid "Clean up 'Cti::Log.'" +msgid "Clean up 'Cti::Log'." msgstr "" #: db/seeds/schedulers.rb