Open meghuizen opened 2 years ago
Hi @meghuizen We are going to move away from this and start to use the Files Service upload hopefully soon, this will solve any such issue with the current method as well. We are awaiting on other teams to give the greenlight to merge the PR we have ready for this.
Hi @Arpit-Sharma-USC thanks for the heads-up on this.
I've looked into the branch and I see you're fully going away from the indirect upload to S3 storage to a more direct approach. Looks good. This makes it a lot easier and more robust.
It's about the following code: https://github.com/Bynder/bynder-c-sharp-sdk/blob/bf704f97f85a11b2c0d0db5fc155ba2c7b6879d5/Bynder/Sdk/Service/Upload/AmazonApi.cs#L30
And see the following article for an explanation on this: https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
But using a singleton (via a static) can also have issues, like: https://byterot.blogspot.com/2016/07/singleton-httpclient-dns.html
Since with this SDK, you can't really rely on Dependency Injection, I would prefer that all HttpClients, this SDK is using, can be injected and configured with Dependency Injection (which deals with the cleanup as well) and otherwise set 1 HttpClient per instance of the API objects.