From ddbbb2d0902f1d475522d2a3538a4409955f68b5 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 14 May 2019 15:42:07 +0200 Subject: allow retries on 500 server errors --- it_url.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it_url.class b/it_url.class index 4135789..12ac64a 100644 --- a/it_url.class +++ b/it_url.class @@ -131,7 +131,7 @@ function get($p=null, $timeout=5) $result = $url->request($p + ['followlocation' => true]); - if (!$result && $p['retries'] > 0 && $url->result < 400 && $url->result != 204) + if (!$result && $p['retries'] > 0 && !it::match('^(4..|204)$', $url->result)) { usleep($p['retrysleep']*1000000); $result = $url->get(array('retries' => $p['retries'] - 1) + $p); -- cgit v1.2.3