lib/ddtrace/contrib/active_support/cache/patcher.rb in ddtrace-0.29.1 vs lib/ddtrace/contrib/active_support/cache/patcher.rb in ddtrace-0.30.0
- old
+ new
@@ -9,52 +9,38 @@
module Patcher
include Contrib::Patcher
module_function
- def patched?
- done?(:cache)
+ def target_version
+ Integration.version
end
def patch
- do_once(:cache) do
- begin
- patch_cache_store_read
- patch_cache_store_fetch
- patch_cache_store_write
- patch_cache_store_delete
- rescue StandardError => e
- Datadog::Tracer.log.error("Unable to apply Active Support cache integration: #{e}")
- end
- end
+ patch_cache_store_read
+ patch_cache_store_fetch
+ patch_cache_store_write
+ patch_cache_store_delete
end
def cache_store_class(meth)
::ActiveSupport::Cache::Store
end
def patch_cache_store_read
- do_once(:patch_cache_store_read) do
- cache_store_class(:read).send(:prepend, Cache::Instrumentation::Read)
- end
+ cache_store_class(:read).send(:prepend, Cache::Instrumentation::Read)
end
def patch_cache_store_fetch
- do_once(:patch_cache_store_fetch) do
- cache_store_class(:fetch).send(:prepend, Cache::Instrumentation::Fetch)
- end
+ cache_store_class(:fetch).send(:prepend, Cache::Instrumentation::Fetch)
end
def patch_cache_store_write
- do_once(:patch_cache_store_write) do
- cache_store_class(:write).send(:prepend, Cache::Instrumentation::Write)
- end
+ cache_store_class(:write).send(:prepend, Cache::Instrumentation::Write)
end
def patch_cache_store_delete
- do_once(:patch_cache_store_delete) do
- cache_store_class(:delete).send(:prepend, Cache::Instrumentation::Delete)
- end
+ cache_store_class(:delete).send(:prepend, Cache::Instrumentation::Delete)
end
end
end
end
end