diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-13 07:22:55 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-13 07:31:08 +0300 |
commit | 567a25b63032a82fd188177ea7a29a92ca2dc381 (patch) | |
tree | 3e4da482eda8279bd5154c37ee3ec04ac39afd5b /config/initializers/session_store.rb | |
parent | 89b56c81d0592390678c846b3a3db1ba35d9f0d4 (diff) |
Ensure `session_expire_delay` field exists before accessing it
Closes #1798
Diffstat (limited to 'config/initializers/session_store.rb')
-rw-r--r-- | config/initializers/session_store.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 43077fb575e..6d274cd95a1 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,8 +1,8 @@ # Be sure to restart your server when you modify this file. -if ActiveRecord::Base.connection.active? && ActiveRecord::Base.connection.table_exists?('application_settings') - Settings.gitlab['session_expire_delay'] = ApplicationSetting.current.session_expire_delay -end +require 'gitlab/current_settings' +include Gitlab::CurrentSettings +Settings.gitlab['session_expire_delay'] = current_application_settings.session_expire_delay Gitlab::Application.config.session_store( :redis_store, # Using the cookie_store would enable session replay attacks. @@ -12,4 +12,4 @@ Gitlab::Application.config.session_store( httponly: true, expire_after: Settings.gitlab['session_expire_delay'] * 60, path: (Rails.application.config.relative_url_root.nil?) ? '/' : Rails.application.config.relative_url_root -)
\ No newline at end of file +) |