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

Set default timeouts #176

Open
sa7mon opened this issue Aug 9, 2023 · 0 comments
Open

Set default timeouts #176

sa7mon opened this issue Aug 9, 2023 · 0 comments
Labels
refactor Code cleanup / optimization
Milestone

Comments

@sa7mon
Copy link
Owner

sa7mon commented Aug 9, 2023

Set a sane timeout for API calls using context

// Set timeout of 5 seconds
ctx := context.TODO()
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()

Test using Vultr objects or http://httpbin.io/delay/3

@sa7mon sa7mon added the refactor Code cleanup / optimization label Aug 9, 2023
@sa7mon sa7mon added this to the Future milestone Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code cleanup / optimization
Projects
None yet
Development

No branches or pull requests

1 participant