You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The date on the current machine must be out of sync ... sleep for a minute to give the API time to cool down
291
+
sleep(60);
292
+
} else {
293
+
thrownewException("Rate limit hit on API yet retry-after time given is in the past. Please check time of local system. Set \$allow-time-slip to true to work around this problem");
294
+
}
295
+
}
296
+
if($this->debug) {
297
+
echo"Vend API rate limit hit\n";
298
+
echo"Time now on local system is ".date('r',time())."\n";
299
+
echo"Sleeping until ".date('r', $retry_after)." (as advised by Vend API) ";
300
+
}
301
+
while(time() < $retry_after) {
302
+
sleep(1);
303
+
if($this->debug) { echo"."; }
304
+
}
305
+
306
+
// We've given the Vend API time to cool down - retry the original request:
307
+
return$this->_request($path, $data, $depage);
308
+
}
309
+
thrownewException("Error: Unexpected HTTP ".$this->requestr->http_code." result from API");
310
+
}
311
+
276
312
if ($depage && isset($result->pagination) && $result->pagination->page == 1) {
277
313
for ($i=2; $i <= $result->pagination->pages; $i++) {
0 commit comments