X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9090c60b28de593b8bb2ce606a9ab35b62b57608..fef69cced85fd6512d352791d9123f8d8449acdc:/services/api/config/application.rb diff --git a/services/api/config/application.rb b/services/api/config/application.rb index 4acde0febd..c09a8e5e47 100644 --- a/services/api/config/application.rb +++ b/services/api/config/application.rb @@ -1,13 +1,31 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require File.expand_path('../boot', __FILE__) require 'rails/all' require 'digest' +module Kernel + def suppress_warnings + verbose_orig = $VERBOSE + begin + $VERBOSE = nil + yield + ensure + $VERBOSE = verbose_orig + end + end +end + if defined?(Bundler) - # If you precompile assets before deploying to production, use this line - Bundler.require(*Rails.groups(:assets => %w(development test))) - # If you want your assets lazily compiled in production, use this line - # Bundler.require(:default, :assets, Rails.env) + suppress_warnings do + # If you precompile assets before deploying to production, use this line + Bundler.require(*Rails.groups(:assets => %w(development test))) + # If you want your assets lazily compiled in production, use this line + # Bundler.require(:default, :assets, Rails.env) + end end module Server @@ -41,6 +59,8 @@ module Server config.active_support.test_order = :sorted + config.action_dispatch.perform_deep_munge = false + I18n.enforce_available_locales = false # Before using the filesystem backend for Rails.cache, check @@ -58,6 +78,9 @@ module Server STDERR.puts("Defaulting to memory cache, " + "because #{default_cache_path} #{why}") config.cache_store = :memory_store + else + require Rails.root.join('lib/safer_file_store') + config.cache_store = ::SaferFileStore.new(default_cache_path) end end end