Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions pkg/app/piped/executor/wait/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,26 @@ func (e *Executor) Execute(sig executor.StopSignal) model.StageStatus {
defer ticker.Stop()

e.LogPersister.Infof("Waiting for %v...", duration)
select {
case <-timer.C:
break

case <-ticker.C:
e.LogPersister.Infof("%v elapsed...", time.Since(startTime))

case s := <-sig.Ch():
switch s {
case executor.StopSignalCancel:
return model.StageStatus_STAGE_CANCELLED
case executor.StopSignalTerminate:
return originalStatus
default:
return model.StageStatus_STAGE_FAILURE
for {
select {
case <-timer.C:
e.LogPersister.Infof("Waited for %v", totalDuration)
return model.StageStatus_STAGE_SUCCESS

case <-ticker.C:
e.LogPersister.Infof("%v elapsed...", time.Since(startTime))

case s := <-sig.Ch():
switch s {
case executor.StopSignalCancel:
return model.StageStatus_STAGE_CANCELLED
case executor.StopSignalTerminate:
return originalStatus
default:
return model.StageStatus_STAGE_FAILURE
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could you please change to use a return instead of the break at line 90.

for {
   select {
   case <- timer.C:
      	e.LogPersister.Infof("Waited for %v", totalDuration)
	return model.StageStatus_STAGE_SUCCESS
   
   case <-ticker.C:
        e.LogPersister.Infof("%v elapsed...", time.Since(startTime))

   case s := <-sig.Ch():
        ....
   }
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I fixed it in git commit --amend

}
}

e.LogPersister.Infof("Waited for %v", totalDuration)
return model.StageStatus_STAGE_SUCCESS
}

func (e *Executor) retrieveStartTime() (t time.Time) {
Expand Down