Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/116 crash on multiple set time out calls #118

Merged

Conversation

ThindalTV
Copy link
Collaborator

@ThindalTV ThindalTV commented Aug 21, 2023

Fixes #116.

Fixes the issue where a static and shared HttpClient was passed around all instances of DeepgramClient, no matter if it was still in memory or not(as the HttpClient was still around anyways). This resulted in any calls to SetTimeout after the first request had been sent from ANY DeepgramClient to fail with an exception.

This also sets up recreation of the HttpClient used inside of the DeepgramClient instance when the timeout changes, so that it can be reset to something else, on a per client basis.


Basically, this makes each DeepgramClient instance independent from each other, and makes it possible to modify the timeout even after the client has been used to send & recieve the first requests.

Copy link
Collaborator

@CopperBeardy CopperBeardy left a comment

Choose a reason for hiding this comment

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

good solution to the issue

@lukeocodes
Copy link
Contributor

is this a breaking change for users?

@CopperBeardy
Copy link
Collaborator

is this a breaking change for users?

none of the changes users will see

@lukeocodes lukeocodes merged commit 4024f82 into deepgram:main Aug 23, 2023
5 checks passed
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.

Multiple calls to SetTimeout on the Deepgram client throws exceptions
3 participants