Skip to content

Commit

Permalink
Play it more safe when dispatching upload variant requests
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Dec 6, 2024
1 parent e670fa6 commit df0f18c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Processor/UploadProductVariantRequestProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public function process(): void

++$i;

// According to https://api.peakwms.com/api/documentation/index.html the rate limit is 240 requests per minute
if ($i % 240 === 0) {
// According to https://api.peakwms.com/api/documentation/index.html the rate limit is 240 requests per minute,
// so we play it safe and dispatch 120 (half) requests per minute
if ($i % 120 === 0) {
$delay += 60_000;
}

Expand Down

0 comments on commit df0f18c

Please sign in to comment.