Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Saving request payload for retry purpose #18

Merged
merged 1 commit into from
Jan 22, 2014
Merged

Saving request payload for retry purpose #18

merged 1 commit into from
Jan 22, 2014

Conversation

manvil
Copy link

@manvil manvil commented Jan 22, 2014

@tstachl

I have observed that when the API hits the rate limit for the current time slice the API throws Invalid JSON error.
Upon deeper investigation I found that the issue is because when retry is attempted after rate limit has been hit, the request which is sent has the response payload of the first API call. This probably causes issues with the Desk server and hence a BadRequest Error is raised. My change is pretty simple where we store the original request env and upon retry the saved env is used rather than the request modified env.

Regards,
Manvil

@@ -9,14 +9,14 @@ def initialize(app, options = {})

def call(env)
retries = @retries
interval = @interval
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this variable as its not being used anywhere in the method

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 93eacf4 on manvil:retry_correction_1 into f69067f on tstachl:master.

@tstachl tstachl merged commit 93eacf4 into tstachl:master Jan 22, 2014
@tstachl
Copy link
Owner

tstachl commented Jan 22, 2014

Thanks for the pull request @manvil!

@manvil
Copy link
Author

manvil commented Jan 22, 2014

👍

@manvil manvil deleted the retry_correction_1 branch January 22, 2014 03:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants