mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-01 21:47:16 +00:00
Report cache diff to Bugsnag in a new tab
This will allow us to see the difference between the cache entry and the actual shopfront. Otherwise, there is no way to see what wasn't refreshed in the cache.
This commit is contained in:
@@ -3,7 +3,14 @@ require 'open_food_network/products_cache_integrity_checker'
|
||||
ProductsCacheIntegrityCheckerJob = Struct.new(:distributor_id, :order_cycle_id) do
|
||||
def perform
|
||||
unless checker.ok?
|
||||
Bugsnag.notify RuntimeError.new("Products JSON differs from cached version for distributor: #{distributor_id}, order cycle: #{order_cycle_id}"), diff: checker.diff.to_s(:text)
|
||||
exception = RuntimeError.new(
|
||||
"Products JSON differs from cached version for distributor: #{distributor_id}, " \
|
||||
"order cycle: #{order_cycle_id}"
|
||||
)
|
||||
|
||||
Bugsnag.notify(exception) do |report|
|
||||
report.add_tab(:products_cache, diff: checker.diff.to_s(:text))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user