File tree Expand file tree Collapse file tree 4 files changed +20
-14
lines changed
Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -2,17 +2,17 @@ source 'https://rubygems.org'
22
33gem 'rails' , '~> 5.2.x'
44
5- gem 'pg' , '~> 0.21.0'
5+ gem 'pg' , '= 0.21.0'
66gem 'activerecord-nulldb-adapter'
77
88gem 'nochmal' , github : 'puzzle/nochmal'
99
1010gem 'acts_as_tree'
1111gem 'aws-sdk-s3' , require : false
1212gem 'bleib'
13- gem 'bootsnap'
13+ gem 'bootsnap' , '>= 1.4.6'
1414gem 'cancancan'
15- gem 'config'
15+ gem 'config' , '>= 2.2.1'
1616gem 'country_select'
1717gem 'daemons'
1818gem 'dalli'
Original file line number Diff line number Diff line change @@ -575,7 +575,7 @@ DEPENDENCIES
575575 better_errors
576576 binding_of_caller
577577 bleib
578- bootsnap
578+ bootsnap ( >= 1.4.6 )
579579 bootstrap-sass
580580 brakeman
581581 bullet
@@ -585,7 +585,7 @@ DEPENDENCIES
585585 chartjs-ror
586586 codez-tarantula
587587 coffee-rails
588- config
588+ config ( >= 2.2.1 )
589589 country_select
590590 daemons
591591 dalli
@@ -619,7 +619,7 @@ DEPENDENCIES
619619 omniauth-rails_csrf_protection
620620 omniauth-saml
621621 paper_trail
622- pg (~> 0.21.0 )
622+ pg (= 0.21.0 )
623623 prawn
624624 prometheus_exporter
625625 protective
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class Application < Rails::Application
6060
6161 memcached_host = ENV [ 'RAILS_MEMCACHED_HOST' ] || 'localhost'
6262 memcached_port = ENV [ 'RAILS_MEMCACHED_PORT' ] || '11211'
63- config . cache_store = :dalli_store , "#{ memcached_host } :#{ memcached_port } "
63+ config . cache_store = :mem_cache_store , "#{ memcached_host } :#{ memcached_port } "
6464
6565 config . middleware . insert_before Rack ::ETag , Rack ::Deflater
6666
Original file line number Diff line number Diff line change 11# Be sure to restart your server when you modify this file.
22
3- def dalli_reachable ?
4- Rails . cache . dalli . stats . values . any?
3+ def cache_reachable ?
4+ Rails . cache . stats . values . any?
55end
66
77def memcache_configured?
88 if Rails . env . production?
99 ENV [ 'RAILS_MEMCACHED_HOST' ] . present?
10- elsif Rails . env . development?
11- true
1210 else
13- false
11+ Rails . env . development?
1412 end
1513end
1614
15+ def skip_memcache_check
16+ ENV [ 'SKIP_MEMCACHE_CHECK' ] . present?
17+ end
18+
1719Rails . application . config . session_store ActionDispatch ::Session ::CacheStore , expire_after : 12 . hours
1820
19- # We expect memcache to work in production. Prevents an error with the rails console on OpenShift
20- if memcache_configured? && !Rails . env . production? && !dalli_reachable?
21+ # We expect memcache to work in production.
22+ # Prevents an error with the rails console on OpenShift
23+ if !skip_memcache_check &&
24+ memcache_configured? &&
25+ !Rails . env . production? &&
26+ !cache_reachable?
2127 fail "As CSRF tokens are read from cache, we require a memcache instance to start"
2228end
You can’t perform that action at this time.
0 commit comments