From fd491e0faee2019c382a503fa484ae8eeb9f649e Mon Sep 17 00:00:00 2001 From: Jon Donovan Date: Wed, 15 Feb 2023 13:39:02 -0800 Subject: [PATCH] Retry bad_gateway in cirq-ionq (#6006) * Retry bad_gateway in cirq-ionq This error occurred due to a cloudflare outage, and should be retried to avoid disrupting automated usage of the libs. --- cirq-ionq/cirq_ionq/ionq_client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cirq-ionq/cirq_ionq/ionq_client.py b/cirq-ionq/cirq_ionq/ionq_client.py index a7cc5561d4a..65b84a0b387 100644 --- a/cirq-ionq/cirq_ionq/ionq_client.py +++ b/cirq-ionq/cirq_ionq/ionq_client.py @@ -25,8 +25,11 @@ import cirq_ionq from cirq_ionq import ionq_exceptions - -RETRIABLE_STATUS_CODES = {requests.codes.internal_server_error, requests.codes.service_unavailable} +RETRIABLE_STATUS_CODES = { + requests.codes.internal_server_error, + requests.codes.bad_gateway, + requests.codes.service_unavailable, +} def _is_retriable(code):