Open flimzy opened 7 years ago
It seems to me that you'd want to do some kind of exponential backoff here. If Sentry thinks it's overloaded, hammering it repeatedly seems like the wrong thing to do.
@flimzy Thank you for contributing. And sorry for my lateness.
429 error
is the kind of error for rate limit
, right?
As @mcpherrinm mentioned, I think it needs some waiting time to guarantee the effectiveness. For example, HTTP library h2non/gentleman has plugin for retry and it implements waiting time to retry. It use millisec scale, but Sentry's rate limit seems calcutlates the events on each minute, so the scale should be more than seconds.
This fixes #31 .
Additional discussion may be warranted before a merge, though, in case the default behavior should possibly be changed.
As of now, I simply expose a
hook.Retries
field, which can be set to non-zero to enable retries. Otherwise, behavior remains the same as before.