* Extract repeated calls to cache_bust.call to iteration over list
This mirrors what the EdgeCache::BustUser service looks like.
It might make sense to have cached_article_paths be a method accepting
a block and yielding paths, and including the collections cache paths
as well.
* Move article path information into a separate method
BustArticle.call now only knows to bust cache for each path associated
with the article, the information about which paths to clear is moved
to a separate `paths_for` method.
I may have gone overboard on this.
* Remove extra blank line
* When busting user cache, also clear the api response
This should fix#13293 by clearing both the UI copy and the api copy of the
user's page.
* Update spec to include the api path
* This change abstracts the DatadogStatsClient into a ForemStatsClient.
The purpose of this abstraction is to set the foundation for a subsequent PR that will allow one to use New Relic for recording Forem stats, instead of Datadog, if there is a New Relic configuration found.
This specific change creates an abstraction layer that can be built upon, without changing any actual default behavior. All specs still pass.
* Use delegate instead of explicit methods.
* Delegate instead of explicit methods.
* Fix the error.
* Refactor according to the suggestions in the comments.
* Ooops. Stats work better when all of the code is committed.
* Removing the alias of count to increment since that was done in error.
* Create bust_page service and spec
* Specify spec with .once
* Create bust_tag service and spec
* Create bust_event service and spec
* Create bust_podcast service and spec
* Add bust_article service
* Make timestamps lambdas
* Remove nil safe operators
* Updated bust_article specs
* Add spec for TIMEFRAMES and relative time
* Refactor edge caching logic to live in EdgeCache::Service
* Rename EdgeCache::Service to EdgeCache::Buster
* Reorganize some code, move from Buster to Bust naming
* Turn CacheBuster into a module
This class used no internal state, so repeatedly creating short-lived objects seems wasteful.
* Consistently use string interpolation and parenthesis
* Destructure arrays into meaningful names, formatting
* Fix request spec for internal classified listings controller
Interestingly this works when asserting directly on the module, but not on a double.
Asserting directly in the module seems sufficient for this test so the indirection
was removed.
* Turn CacheBuster into a module
This class used no internal state, so repeatedly creating short-lived objects seems wasteful.
* Fix specs after rebasing