77 "github.com/pkg/errors"
88 "github.com/spf13/viper"
99 "net/http"
10+ "time"
1011
1112 errorConstants "github.com/checkmarx/ast-cli/internal/constants/errors"
1213 commonParams "github.com/checkmarx/ast-cli/internal/params"
@@ -32,7 +33,7 @@ func (p *ProjectsHTTPWrapper) Create(model *Project) (*ProjectResponseModel, *Er
3233 fn := func () (* http.Response , error ) {
3334 return SendHTTPRequest (http .MethodPost , p .path , bytes .NewBuffer (jsonBytes ), true , clientTimeout )
3435 }
35- resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay )
36+ resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay * time . Millisecond )
3637 if err != nil {
3738 return nil , nil , err
3839 }
@@ -54,7 +55,7 @@ func (p *ProjectsHTTPWrapper) Update(projectID string, model *Project) error {
5455 fn := func () (* http.Response , error ) {
5556 return SendHTTPRequest (http .MethodPut , fmt .Sprintf ("%s/%s" , p .path , projectID ), bytes .NewBuffer (jsonBytes ), true , clientTimeout )
5657 }
57- resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay )
58+ resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay * time . Millisecond )
5859 if err != nil {
5960 return err
6061 }
@@ -87,7 +88,7 @@ func (p *ProjectsHTTPWrapper) UpdateConfiguration(projectID string, configuratio
8788 fn := func () (* http.Response , error ) {
8889 return SendHTTPRequestWithQueryParams (http .MethodPatch , "api/configuration/project" , params , bytes .NewBuffer (jsonBytes ), clientTimeout )
8990 }
90- resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay )
91+ resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay * time . Millisecond )
9192 if err != nil {
9293 return nil , err
9394 }
@@ -111,7 +112,7 @@ func (p *ProjectsHTTPWrapper) Get(params map[string]string) (
111112 fn := func () (* http.Response , error ) {
112113 return SendHTTPRequestWithQueryParams (http .MethodGet , p .path , params , nil , clientTimeout )
113114 }
114- resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay )
115+ resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay * time . Millisecond )
115116 if err != nil {
116117 return nil , nil , err
117118 }
@@ -152,7 +153,7 @@ func (p *ProjectsHTTPWrapper) GetByID(projectID string) (
152153 fn := func () (* http.Response , error ) {
153154 return SendHTTPRequest (http .MethodGet , p .path + "/" + projectID , http .NoBody , true , clientTimeout )
154155 }
155- resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay )
156+ resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay * time . Millisecond )
156157 if err != nil {
157158 return nil , nil , err
158159 }
@@ -199,7 +200,7 @@ func (p *ProjectsHTTPWrapper) GetBranchesByID(projectID string, params map[strin
199200 fn := func () (* http.Response , error ) {
200201 return SendHTTPRequestWithQueryParams (http .MethodGet , p .path + request , params , nil , clientTimeout )
201202 }
202- resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay )
203+ resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay * time . Millisecond )
203204 if err != nil {
204205 return nil , nil , err
205206 }
@@ -237,7 +238,7 @@ func (p *ProjectsHTTPWrapper) Delete(projectID string) (*ErrorModel, error) {
237238 fn := func () (* http.Response , error ) {
238239 return SendHTTPRequest (http .MethodDelete , p .path + "/" + projectID , http .NoBody , true , clientTimeout )
239240 }
240- resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay )
241+ resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay * time . Millisecond )
241242 if err != nil {
242243 return nil , err
243244 }
@@ -258,7 +259,7 @@ func (p *ProjectsHTTPWrapper) Tags() (
258259 fn := func () (* http.Response , error ) {
259260 return SendHTTPRequest (http .MethodGet , p .path + "/tags" , http .NoBody , true , clientTimeout )
260261 }
261- resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay )
262+ resp , err := retryHTTPRequest (fn , retryAttempts , retryDelay * time . Millisecond )
262263 if err != nil {
263264 return nil , nil , err
264265 }
0 commit comments