Skip to content

Conversation

@tomlm
Copy link
Contributor

@tomlm tomlm commented Sep 5, 2018

HttpResponseMessage implements IDispose, which internally calls .Dispose() on the HttpContent passed into PostAsync(), invalidating the content that was attempted to be reusued in another request.

This fix creates a new Content to be submitted on every attempt by moving the FormUrlEncodedContent inside the retry loop

@tomlm tomlm merged commit bcc34dc into master Sep 5, 2018
@tomlm tomlm deleted the tomlm/fixobjectdisposed branch September 5, 2018 16:27

// try again in a bit to prevent hammering a service if it's not working
await Task.Delay((int)TimeSpan.FromSeconds(1).TotalMilliseconds);
await Task.Delay(TimeSpan.FromSeconds(30));
Copy link
Member

Choose a reason for hiding this comment

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

30 seconds? Is this change intentional? (that's a long time)

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

Successfully merging this pull request may close these issues.

3 participants