diff --git a/cmd/wfxctl/cmd/job/events/events.go b/cmd/wfxctl/cmd/job/events/events.go index 39f12dfc..a02ad2b4 100644 --- a/cmd/wfxctl/cmd/job/events/events.go +++ b/cmd/wfxctl/cmd/job/events/events.go @@ -16,6 +16,7 @@ import ( "net/http" "os" "strings" + "time" "github.com/Southclaws/fault" "github.com/go-openapi/runtime" @@ -89,9 +90,16 @@ func (t SSETransport) Submit(op *runtime.ClientOperation) (interface{}, error) { httpClient.Timeout = 0 client := sse.Client{ - HTTPClient: httpClient, - DefaultReconnectionTime: sse.DefaultClient.DefaultReconnectionTime, - ResponseValidator: validator(t.out), + HTTPClient: httpClient, + Backoff: sse.Backoff{ + InitialInterval: 5 * time.Second, + Multiplier: 1.5, + Jitter: 0.5, + MaxInterval: 60 * time.Second, + MaxElapsedTime: 15 * time.Minute, + MaxRetries: -1, + }, + ResponseValidator: validator(t.out), } conn := client.NewConnection(req) diff --git a/go.mod b/go.mod index 837e3078..4a336057 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/steinfletcher/apitest v1.5.15 github.com/steinfletcher/apitest-jsonpath v1.7.2 github.com/stretchr/testify v1.8.4 - github.com/tmaxmax/go-sse v0.7.0 + github.com/tmaxmax/go-sse v0.8.0 github.com/tsenart/vegeta/v12 v12.11.1 github.com/yourbasic/graph v0.0.0-20210606180040-8ecfec1c2869 go.uber.org/automaxprocs v1.5.3 @@ -93,7 +93,6 @@ require ( require ( github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-openapi/analysis v0.22.2 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index e2ebcd0e..02ec28bb 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,6 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/bmizerany/perks v0.0.0-20230307044200-03f9df79da1e h1:mWOqoK5jV13ChKf/aF3plwQ96laasTJgZi4f1aSOu+M= github.com/bmizerany/perks v0.0.0-20230307044200-03f9df79da1e/go.mod h1:ac9efd0D1fsDb3EJvhqgXRbFx7bs2wqZ10HQPeU8U/Q= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 h1:ox2F0PSMlrAAiAdknSRMDrAr8mfxPCfSZolH+/qQnyQ= github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08/go.mod h1:pCxVEbcm3AMg7ejXyorUXi6HQCzOIBf7zEDVPtw0/U4= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -235,8 +233,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/tmaxmax/go-sse v0.7.0 h1:5cMmA9v1YxxnB8D3h2j3YRkLIVLzt4IAwRLOesQY884= -github.com/tmaxmax/go-sse v0.7.0/go.mod h1:86RhFezBCIdDFddwc+pbcqb5GKAsfR7d86Oxb9xLHMg= +github.com/tmaxmax/go-sse v0.8.0 h1:pPpTgyyi1r7vG2o6icebnpGEh3ebcnBXqDWkb7aTofs= +github.com/tmaxmax/go-sse v0.8.0/go.mod h1:HLoxqxdH+7oSUItjtnpxjzJedfr/+Rrm/dNWBcTxJFM= github.com/tsenart/go-tsz v0.0.0-20180814235614-0bd30b3df1c3 h1:pcQGQzTwCg//7FgVywqge1sW9Yf8VMsMdG58MI5kd8s= github.com/tsenart/go-tsz v0.0.0-20180814235614-0bd30b3df1c3/go.mod h1:SWZznP1z5Ki7hDT2ioqiFKEse8K9tU2OUvaRI0NeGQo= github.com/tsenart/vegeta/v12 v12.11.1 h1:Rbwe7Zxr7sJ+BDTReemeQalYPvKiSV+O7nwmUs20B3E= diff --git a/go.work.sum b/go.work.sum index 53136606..36192e4a 100644 --- a/go.work.sum +++ b/go.work.sum @@ -38,6 +38,7 @@ github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11/go.mod h1:fmgDANqTUCxciViKl9hb/ github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= +github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=