Skip to content

Commit

Permalink
Replace deprecated wait.PollImmediate with wait.PollUntilContextTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
typeid committed Nov 15, 2023
1 parent 00992e9 commit a607dfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/ocm-backplane/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ func runConsole(cmd *cobra.Command, argv []string) (err error) {

if consoleArgs.openBrowser {
go func() {
err := wait.PollImmediate(time.Second, 5*time.Second, func() (bool, error) {
err := wait.PollUntilContextTimeout(context.Background(), time.Second, 5*time.Second, true, func(context.Context) (bool, error) {
return utils.CheckHealth(fmt.Sprintf("%s/health", consoleURL)), nil
})
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/ocm-backplane/managedJob/createManagedJob.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func createJob(client BackplaneApi.ClientInterface) (*BackplaneApi.Job, error) {
// waitForCreateJob timeouts after 10 min
func waitForCreateJob(client BackplaneApi.ClientInterface, job *BackplaneApi.Job) (statusMessage string, err error) {

pollErr := wait.PollImmediate(10*time.Second, time.Duration(600)*time.Second, func() (bool, error) {
pollErr := wait.PollUntilContextTimeout(context.Background(), 10*time.Second, time.Duration(600)*time.Second, true, func(context.Context) (bool, error) {
fmt.Printf(".")

// Get the current job
Expand Down Expand Up @@ -242,7 +242,7 @@ func waitForCreateJob(client BackplaneApi.ClientInterface, job *BackplaneApi.Job
// fetchJobLogs stream the log of the job to the console output when the job status is Running, Succeeded or Failed
func fetchJobLogs(client BackplaneApi.ClientInterface, job *BackplaneApi.Job) error {

pollErr := wait.PollImmediate(5*time.Second, 1*time.Minute, func() (bool, error) {
pollErr := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, 1*time.Minute, true, func(context.Context) (bool, error) {
fmt.Printf(".")

// Get the current job
Expand Down

0 comments on commit a607dfd

Please sign in to comment.