mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-10 01:00:05 +00:00
[core] Fix: Do not retry any request with body
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
dbb9aae82a
commit
f7d1f09b5c
1 changed files with 2 additions and 4 deletions
|
@ -16,7 +16,6 @@ import (
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/Luzifer/go_helpers/v2/backoff"
|
"github.com/Luzifer/go_helpers/v2/backoff"
|
||||||
"github.com/Luzifer/go_helpers/v2/str"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -604,9 +603,8 @@ func (c *Client) request(opts clientRequestOpts) error {
|
||||||
}).Trace("Execute Twitch API request")
|
}).Trace("Execute Twitch API request")
|
||||||
|
|
||||||
var retries uint64 = twitchRequestRetries
|
var retries uint64 = twitchRequestRetries
|
||||||
if str.StringInSlice(opts.Method, []string{
|
if opts.Body != nil {
|
||||||
http.MethodPost, // Creates stuff, must not be retried without being asked
|
// Body must be read only once, do not retry
|
||||||
}) {
|
|
||||||
retries = 1
|
retries = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue