forked from External/greenlight
GRN2-xx: Migration Error now returns 500 and added the option to disable cache (#776)
* Added the option to disable cache * Remove put statements
This commit is contained in:
parent
1eddd564d5
commit
02413cefb2
|
@ -49,7 +49,7 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
# Show an information page when migration fails and there is a version error.
|
# Show an information page when migration fails and there is a version error.
|
||||||
def migration_error?
|
def migration_error?
|
||||||
render :migration_error unless ENV["DB_MIGRATE_FAILED"].blank?
|
render :migration_error, status: 500 unless ENV["DB_MIGRATE_FAILED"].blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
def maintenance_mode?
|
def maintenance_mode?
|
||||||
|
|
|
@ -118,6 +118,9 @@ module Greenlight
|
||||||
|
|
||||||
config.google_analytics = ENV["GOOGLE_ANALYTICS_TRACKING_ID"].present?
|
config.google_analytics = ENV["GOOGLE_ANALYTICS_TRACKING_ID"].present?
|
||||||
|
|
||||||
|
# Will always be true unless explicitly set to false
|
||||||
|
config.enable_cache = ENV["ENABLE_CACHED_PROVIDER"] != "false"
|
||||||
|
|
||||||
# MAINTENANCE
|
# MAINTENANCE
|
||||||
config.maintenance_window = ENV["MAINTENANCE_WINDOW"]
|
config.maintenance_window = ENV["MAINTENANCE_WINDOW"]
|
||||||
config.maintenance_mode = ENV["MAINTENANCE_MODE"] == "true"
|
config.maintenance_mode = ENV["MAINTENANCE_MODE"] == "true"
|
||||||
|
|
|
@ -28,7 +28,8 @@ module BbbApi
|
||||||
raise "Provider not included." if !provider || provider.empty?
|
raise "Provider not included." if !provider || provider.empty?
|
||||||
|
|
||||||
cached_provider = Rails.cache.fetch("#{provider}/#{route}")
|
cached_provider = Rails.cache.fetch("#{provider}/#{route}")
|
||||||
return cached_provider unless cached_provider.nil?
|
# Return cached result if the value exists and cache is enabled
|
||||||
|
return cached_provider if !cached_provider.nil? && Rails.configuration.enable_cache
|
||||||
|
|
||||||
# Build the URI.
|
# Build the URI.
|
||||||
uri = encode_bbb_url(
|
uri = encode_bbb_url(
|
||||||
|
|
Loading…
Reference in New Issue