Skip to content

Commit

Permalink
Merge pull request #466 from rickbeasley/main
Browse files Browse the repository at this point in the history
444: retry on curl eof error
  • Loading branch information
jrchamp authored Mar 16, 2023
2 parents 869f5e0 + 240b552 commit 6673a2d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion classes/webservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,16 @@ private function make_call($path, $data = [], $method = 'get') {
$data = is_array($data) ? json_encode($data) : $data;
}

$rawresponse = $this->make_curl_call($curl, $method, $url, $data);
$attempts = 0;
do {
if ($attempts > 0) {
sleep(1);
debugging('retrying after curl error 35, retry attempt ' . $attempts);
}

$rawresponse = $this->make_curl_call($curl, $method, $url, $data);
$attempts++;
} while ($curl->get_errno() === 35 && $attempts <= self::MAX_RETRIES);

if ($curl->get_errno()) {
throw new moodle_exception('errorwebservice', 'mod_zoom', '', $curl->error);
Expand Down

0 comments on commit 6673a2d

Please sign in to comment.