mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
discord: retry auth/command register, do latter in bulk
re-use the auth retry options from the config for initial d.bot.Open and
for registering commands. The latetr is now done with the BulkOverwrite
method, since it seems to work now. For #427.
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
lm "github.com/hrfee/jfa-go/logmessages"
|
||||
)
|
||||
@@ -155,3 +156,11 @@ func decodeResp(resp *http.Response) (string, error) {
|
||||
}
|
||||
return buf.String(), nil
|
||||
}
|
||||
|
||||
// MustAuthenticateOptions is used to control the behaviour of the MustAuthenticate-like methods.
|
||||
type MustAuthenticateOptions struct {
|
||||
RetryCount int // Number of Retries before failure.
|
||||
RetryGap time.Duration // Duration to wait between tries.
|
||||
LogFailures bool // Whether or not to print failures to the log.
|
||||
Counter int // The current retry count.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user