Skip to content

Commit

Permalink
Fix operator precedence to avoid div/0 error
Browse files Browse the repository at this point in the history
  • Loading branch information
joecampo committed Dec 6, 2021
1 parent 7593cb4 commit e423313
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ShipStation.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function sleepIfRateLimited(Response $response)
$this->remainingRequests = (int) $response->getHeader('X-Rate-Limit-Remaining')[0];
$this->secondsUntilReset = (int) $response->getHeader('X-Rate-Limit-Reset')[0];

if (($this->secondsUntilReset / $this->remainingRequests) > 1.5 || $this->isRateLimited()) {
if ($this->isRateLimited() || ($this->secondsUntilReset / $this->remainingRequests) > 1.5) {
sleep(1.5);
}
}
Expand Down

0 comments on commit e423313

Please sign in to comment.