feat: use gopencils retrial option, upgrade version

This commit is contained in:
iyz
2025-04-04 14:17:59 -04:00
committed by Manuel Rüger
parent dda17fcb55
commit d789261c9a
3 changed files with 10 additions and 9 deletions

View File

@@ -105,7 +105,7 @@ func NewAPI(baseURL string, username string, password string) *API {
Password: password,
}
}
rest := gopencils.Api(baseURL+"/rest/api", auth)
rest := gopencils.Api(baseURL+"/rest/api", auth, 3) // set option for 3 retries on failure
if username == "" {
if rest.Headers == nil {
rest.Headers = http.Header{}
@@ -113,10 +113,7 @@ func NewAPI(baseURL string, username string, password string) *API {
rest.SetHeader("Authorization", fmt.Sprintf("Bearer %s", password))
}
json := gopencils.Api(
baseURL+"/rpc/json-rpc/confluenceservice-v2",
auth,
)
json := gopencils.Api(baseURL+"/rpc/json-rpc/confluenceservice-v2", auth, 3)
if log.GetLevel() == lorg.LevelTrace {
rest.Logger = &tracer{"rest:"}