Do not notify Bugsnag of a cache miss

It's not the responsibility of a error tracking software to track
neither cache misses nor logs. That is what log monitoring is for.
This commit is contained in:
Pau Perez
2017-11-02 16:52:49 +01:00
parent 98603c4042
commit 84e4ebef08
2 changed files with 0 additions and 38 deletions

View File

@@ -26,17 +26,9 @@ module OpenFoodNetwork
private
def log_warning
if Rails.env.production? || Rails.env.staging?
Bugsnag.notify RuntimeError.new("Live server MISS on products cache for distributor: #{@distributor.id}, order cycle: #{@order_cycle.id}")
end
end
def cached_products_json
if Rails.env.production? || Rails.env.staging?
Rails.cache.fetch("products-json-#{@distributor.id}-#{@order_cycle.id}") do
log_warning
begin
uncached_products_json
rescue ProductsRenderer::NoProducts