Comments (6)
This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.
from hcloud-go.
Hey @mschfh,
plainly retrying requests could be a bit dangerous, as we do not have an idempotent API. Actions might be taken twice, if the actual API request arrived at the backend, but then some proxy in the middle fails the request.
Do you know of any SDKs/API Clients which do this?
from hcloud-go.
afaik aws's SDK does this
https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html
from hcloud-go.
This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.
from hcloud-go.
unstale
from hcloud-go.
Until we find out the best approach to solve this, you may use an external library that implement a retry round tripper:
package main
import (
"net/http"
"github.com/hashicorp/go-retryablehttp"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
)
func main() {
token := "YOUR_API_TOKEN"
httpClient := &http.Client{}
httpClient.Transport = &retryablehttp.RoundTripper{}
hcloud.NewClient(
hcloud.WithToken(token),
hcloud.WithHTTPClient(httpClient),
)
}
from hcloud-go.
Related Issues (20)
- feat: Return action from Server.Delete
- feat: WaitForAction with Exponential Backoff
- CloudQuery Source Plugin? HOT 1
- Dependency Dashboard
- No password when rebuilding from image HOT 2
- feat: Make sure all Clients have .AllWithOpts method
- refactor: duplicate implementation for .All & .AllWithOpts
- Breaking Change: ID fields will become int64 HOT 2
- Action Required: Fix Renovate Configuration HOT 4
- fix: panic when multiple hcloud-go Client with Instrumentation are registered
- Hetzner API request: ability to know if server count limit has been reached HOT 2
- Feature Request: Duplicate struct as -Opts HOT 5
- Using pointers for basic types HOT 4
- Add testing package to provide test utils to downstream projects HOT 1
- Search matches only whole words HOT 1
- Release-please doesn't autodetect the target branch HOT 1
- func (c *Client) NewRequest(ctx context.Context, method, path string, body io.Reader) (*http.Request, error) {<a href="https://app.codacy.com/gh/Sarakbe/Sarakbe/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/5068d703d736450398603dc8f435b9f5"/></a>
- API of add/remove target to/from load balancer is inconsistent with console UI HOT 1
- A way to get the project ID HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hcloud-go.