Skip to content

Commit

Permalink
fix: change Promise.race to Promise.all on products and skus imports
Browse files Browse the repository at this point in the history
  • Loading branch information
tiago-freire committed Jan 31, 2025
1 parent bd0712f commit 892ae69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion node/events/steps/03-products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const handleProducts = async (context: AppEventContext) => {
taskQueue.push(task)

if (taskQueue.length >= MAX_CONCURRENT_TASKS) {
await Promise.race(taskQueue)
await Promise.all(taskQueue)
taskQueue.splice(0, taskQueue.findIndex((t) => t === task) + 1)
}
}
Expand Down
2 changes: 1 addition & 1 deletion node/events/steps/04-skus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const handleSkus = async (context: AppEventContext) => {
taskQueue.push(task)

if (taskQueue.length >= MAX_CONCURRENT_TASKS) {
await Promise.race(taskQueue)
await Promise.all(taskQueue)
taskQueue.splice(0, taskQueue.findIndex((t) => t === task) + 1)
}
}
Expand Down

0 comments on commit 892ae69

Please sign in to comment.