~singpolyma/whiplash-mboa

e06ff1b8cb5b8718d13be377fe6c1472511fdc81 — Stephen Paul Weber 1 year, 9 months ago 59d5800
Basically ignore 500s from whiplash because they happen so often
1 files changed, 5 insertions(+), 1 deletions(-)

M app/jobs/sync_whiplash_order_status_job.rb
M app/jobs/sync_whiplash_order_status_job.rb => app/jobs/sync_whiplash_order_status_job.rb +5 -1
@@ 16,7 16,11 @@ class SyncWhiplashOrderStatusJob < ApplicationJob
				{ provider: "api", limit: 200, status: [40, 95, 300] },
				"X-API-KEY" => shop.whiplash_api_key
			)
			raise response.inspect if response.is_a?(String) || response.status >= 400
			if response.status == 500
				Rails.logger.error("500 response from whiplash for shop #{shop.shopify_domain}")
				return
			end
			raise response.body.to_s if response.is_a?(String) || response.status >= 400

			response.body.each do |order|
				next unless order["originator_id"]