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.14.2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.15.0 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.15.0.rc2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.15.0.rc1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.14.1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.14.0 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.14.0.rc3 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.14.0.rc2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.14.0.rc1.1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.14.0.rc1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.13.1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.13.0 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.12.1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.13.0.rc1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.12.0 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.12.0.rc3 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.12.0.rc2 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.12.0.rc1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.11.1 db/migrate/20220209205137_expand_sync_timeout_settings.rb
katello-4.11.0 db/migrate/20220209205137_expand_sync_timeout_settings.rb