From 567a25b63032a82fd188177ea7a29a92ca2dc381 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 13 Jun 2015 00:22:55 -0400 Subject: Ensure `session_expire_delay` field exists before accessing it Closes #1798 --- config/initializers/session_store.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'config') 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 +) -- cgit v1.2.1