Allow reactive caching to be used in services
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?
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer
Edited by Michael Kozono