MindscapeHQ / raygun4net

Raygun provider for .NET
https://raygun.com
MIT License
126 stars 93 forks source link

Refactor NetCore package for singleton HttpClient as well. #422

Closed DanFTRX closed 4 years ago

DanFTRX commented 4 years ago

It has already been done for the AspNet package But the .NetCore packages still instantiates a new HttpClient on every send, and it cannot be configured either. Could the same/similar changes be made for the .Net Core Raygun?

https://github.com/MindscapeHQ/raygun4net/blob/master/Mindscape.Raygun4Net.NetCore.Common/RaygunClientBase.cs#L374

BarsikV commented 4 years ago

I don't really know what has been changed, but the AspNetCore package references the regular .NetCore.Common package. The RaygunClient class in AspNetCore uses the RaygunClientBase from the .Common package as a base class. Thus, it is creating a new HttpClient every time and exception is sent in all cases.

DanFTRX commented 4 years ago

@BarsikV You're right, my bad, its the Regular framework aspnet not the aspnet core that was updated.

BarsikV commented 4 years ago

This was first resolved by #409 , but then the PR was reverted by #410 . Please fix the issue with HttpClient and make it Singleton, static or configurable. It's harming our services.

mduncan26 commented 4 years ago

Hi @BarsikV and @DanFTRX,

I apologise for this issue occurring again. We are working on some changes to the Raygun4Net providers right now and we will include a fix for this. I will update this thread once those changes are available.

Thank you, Mitchell.

BarsikV commented 4 years ago

Thank you, me and my team very much appreciate it. Looking forward to it!

mduncan26 commented 4 years ago

Hi @BarsikV and @DanFTRX,

We have just released an update (v6.3.1) to the .NET Core providers to use a single HTTP client.

https://www.nuget.org/packages/Mindscape.Raygun4Net.AspNetCore/6.3.1 https://www.nuget.org/packages/Mindscape.Raygun4Net.NetCore/6.3.1

Please update and let me know if the issue has been resolved.

Thank you for your patience.

Regards, Mitchell.

DanFTRX commented 4 years ago

@mduncan26 WIth that back, maybe yall can revisit #322