summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-13 00:22:55 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-06-13 00:31:08 -0400
commit567a25b63032a82fd188177ea7a29a92ca2dc381 (patch)
tree3e4da482eda8279bd5154c37ee3ec04ac39afd5b /config
parent89b56c81d0592390678c846b3a3db1ba35d9f0d4 (diff)
downloadgitlab-ce-567a25b63032a82fd188177ea7a29a92ca2dc381.tar.gz
Ensure `session_expire_delay` field exists before accessing itrs-issue-1798
Closes #1798
Diffstat (limited to 'config')
-rw-r--r--config/initializers/session_store.rb8
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
+)