Skip to content

Commit

Permalink
fix(throttle): change throttle to throw exception instead of retry
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnhind committed Apr 29, 2019
1 parent 3a81ea7 commit 928d01a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/CurlRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected static function processRequest($ch, $url)
},

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

if (isset($output)) {
Expand Down
7 changes: 7 additions & 0 deletions lib/Exception/ThrottleException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace PHPShopify\Exception;

class ThrottleException extends \Exception
{
}

0 comments on commit 928d01a

Please sign in to comment.