20210426000002_update_session_timeout_defaults.rb 472 B

12345678910111213141516
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class UpdateSessionTimeoutDefaults < ActiveRecord::Migration[5.2]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. defaults = Setting.get('session_timeout')
  6. %w[default admin ticket.agent ticket.customer].each do |key|
  7. next if defaults[key].to_i != 172_800
  8. defaults[key] = 4.weeks.seconds
  9. end
  10. Setting.set('session_timeout', defaults)
  11. end
  12. end