mozilla / openbadges-badgekit

No Longer Maintained
https://badgekit.org
Mozilla Public License 2.0
123 stars 84 forks source link

WebhookRequestError when issuing badges to multiple emails #465

Closed danharel closed 9 years ago

danharel commented 9 years ago

Hey guys!

I've been trying to setup Open Badges for my university's staff to use. I currently have it working for the most part. I've implemented the functionality for a user to award a badge to multiple users at one time then email each user. The badge is awarded properly; I can verify this through the logs. However, when it comes time for the API to fire off the webhook and send a POST to the given URL, it doesn't completely work. If I award the badge to 9 users, usually only about 6 of them will receive the email. For the other 3 instances, the code associated with the webhook is never reached. According to the API logs, this is what is printed when these 3 instances are processed:

{ "name":"badgekit-api", "hostname":"5255fsdf-v53h-9fds-3gd3-87439d4k6g2", "pid":2, "level":40, "code":"WebhookRequestError", "error":{ "code":"ECONNRESET" }, "msg":"", "time":"2014-08-27T14:21:53.815Z", "v":0 }

As you can see, the message code is "WebhookRequestError", and the error code is "ECONNRESET".

I was thinking that the problem is that the API isn't meant to handle so many requests at the same time, and shuts the user out after too many requests. But this is just a theory. I looked up the error message, and nothing came up. Does anybody have any idea why this is happening and how I can get around it?

Thanks! Dan Harel