mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-14 23:47:48 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user