Skip to content

Allow reactive caching to be used in services

Reuben Pereira requested to merge 58375-reactive-caching-changes into master

What does this MR do?

The ReactiveCachingWorker currently relies on the ActiveRecord#find_by method to get the original object. This limits use of ReactiveCaching to only ActiveRecord models.

This MR adds a reactive_cache_worker_finder which allows classes to define a method that will be called by ReactiveCachingWorker. This method should return an object of the class that includes ReactiveCaching. This allows ReactiveCache to be used by classes that are not ActiveRecord models e.g service classes suche as Prometheus::ProxyService.

What are the relevant issue numbers?

#58375 (closed)

Does this MR meet the acceptance criteria?

Edited by Michael Kozono

Merge request reports