From 9f87de5935c8f0de73203db17f309ea7be03fe91 Mon Sep 17 00:00:00 2001 From: Vincent Pochet Date: Mon, 14 Oct 2024 17:38:20 +0200 Subject: [PATCH] fix(integration): Fix rate limit handling --- app/services/integrations/aggregator/base_service.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/services/integrations/aggregator/base_service.rb b/app/services/integrations/aggregator/base_service.rb index ea96d34c300..fca83c4a0e4 100644 --- a/app/services/integrations/aggregator/base_service.rb +++ b/app/services/integrations/aggregator/base_service.rb @@ -123,9 +123,7 @@ def message(error) def request_limit_error?(http_error) return false unless http_error.error_code.to_i == 500 - http_error.json_message.dig('error', 'payload', 'error', 'code') == REQUEST_LIMIT_ERROR_CODE - rescue JSON::ParserError - false + http_error.error_body.include?(REQUEST_LIMIT_ERROR_CODE) end end end