Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent SumbitFeed requests fail because of md5 value. #140

Open
VTTodorov opened this issue Jun 8, 2020 · 2 comments
Open

Concurrent SumbitFeed requests fail because of md5 value. #140

VTTodorov opened this issue Jun 8, 2020 · 2 comments
Assignees

Comments

@VTTodorov
Copy link

VTTodorov commented Jun 8, 2020

Im sending about 20 concurrent requests using Promise.all. The code looks like this:
let amazonMws = require('amazon-mws')(KEY, SECRET)
let promises = [];
for (...) {
promise.push(amazonMws.feeds.submit(...));
}
let results = await Promise.all(promises);

Result: Often 1 or more of those 20 requests return error with message: "the Content-MD5 HTTP header you passed for your feed did not match the Content-MD5 we calculated for your feed". I'm 99% sure that the error is caused because the library keeps its RequestHeaders object as a parameter for the amazonMws instance. Any idea how to prevent getting those errors without having to instantiate new amazon-mws instance for each call?

PS. Instantiating new instance for each concurrent call fixes the issue.

@bhushankummar
Copy link
Owner

@VTTodorov Sure, I will review it. Please feel free to add if you have suggestions on this.

@hoangtrucit
Copy link

I have same problem when use multiple instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants