Skip to content

Commit 928d01a

Browse files
committed
fix(throttle): change throttle to throw exception instead of retry
1 parent 3a81ea7 commit 928d01a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/CurlRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ protected static function processRequest($ch, $url)
152152
},
153153

154154
function () {
155-
usleep(250000);
155+
throw new Exception\ThrottleException("Could not get lock on API resource in Redis.");
156156
});
157157

158158
if (isset($output)) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace PHPShopify\Exception;
4+
5+
class ThrottleException extends \Exception
6+
{
7+
}

0 commit comments

Comments
 (0)