DEV: avoid require_dependency for some libs

This avoids require dependency on method_profiler and anon cache.

It means that if there is any change to these files the reloader will not pick it up.

Previously the reloader was picking up the anon cache twice causing it to double load on boot.

This caused warnings.

Long term my plan is to give up on require dependency and instead use:

https://github.com/Shopify/autoload_reloader
This commit is contained in:
Sam 2018-12-31 10:53:30 +11:00
parent fef45789c4
commit a19170a4c2
3 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
require_dependency "middleware/anonymous_cache"
require "middleware/anonymous_cache"
enabled =
if Rails.configuration.respond_to?(:enable_anon_caching)

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require_dependency 'method_profiler'
require 'method_profiler'
# This module allows us to hijack a request and send it to the client in the deferred job queue
# For cases where we are making remote calls like onebox or proxying files and so on this helps

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
require_dependency 'middleware/anonymous_cache'
require_dependency 'method_profiler'
require 'method_profiler'
require 'middleware/anonymous_cache'
class Middleware::RequestTracker