Sha256: 05814ebbfaa96bdcd9377d6493208edca9a026a03e1f9e3e678d5dfec6eb4e8c

Contents?: true

Size: 1.03 KB

Versions: 56

Compression:

Stored size: 1.03 KB

Contents

class ExpandSyncTimeoutSettings < ActiveRecord::Migration[6.0]
  def up
    old_timeout_setting = Setting.find_by(name: 'sync_connect_timeout')
    if old_timeout_setting && (old_timeout_setting&.value != old_timeout_setting&.default)
      Setting.find_by(name: 'sync_total_timeout')&.update(value: old_timeout_setting&.value)
      Setting.find_by(name: 'sync_sock_read_timeout')&.update(value: old_timeout_setting&.value)
    end
    Setting.where(name: 'sync_connect_timeout').delete_all
  end

  def down
    timeout = Setting.find_by(name: 'sync_total_timeout')&.value

    Setting.where(name: 'sync_total_timeout').delete_all
    Setting.where(name: 'sync_connect_timeout_v2').delete_all
    Setting.where(name: 'sync_sock_connect_timeout').delete_all
    Setting.where(name: 'sync_sock_read_timeout').delete_all

    Setting.create(Setting.set('sync_connect_timeout', N_("Timeout in seconds for downloads when syncing"),
      300, N_('Sync Connection Timeout')))
    Setting.find_by(name: 'sync_connect_timeout')&.update(value: timeout)
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
katello-4.11.0.rc2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.11.0.rc1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.10.0 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.9.2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.10.0.rc2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.10.0.rc1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.8.4 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.9.1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.8.3 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.9.0 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.7.6 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.8.2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.9.0.rc2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.9.0.rc1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.8.1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.7.5 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.8.0 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.8.0.rc2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.7.4 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.8.0.rc1 db/migrate/20220209205137_expand_sync_timeout_settings.rb