Skip to content

Commit

Permalink
improve wait workflow timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed Feb 21, 2024
1 parent 4c5d4df commit d7cd2b1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions service/api/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ func (s *serviceImpl) ApiV1WorkflowWaitForStateCompletion(
defer cancFunc()
var output service.WaitForStateCompletionWorkflowOutput
getErr := s.client.GetWorkflowResult(subCtx, &output, workflowId, runId)

if s.client.IsRequestTimeoutError(getErr) {
// the workflow is still running, but the wait has exceeded limit
return nil, errors.NewErrorAndStatus(
service.HttpStatusCodeSpecial4xxError1,
iwfidl.LONG_POLL_TIME_OUT_SUB_STATUS,
"waiting has exceeded timeout limit")
}

Check warning on line 164 in service/api/service.go

View check run for this annotation

Codecov / codecov/patch

service/api/service.go#L159-L164

Added lines #L159 - L164 were not covered by tests

if getErr != nil {
return nil, s.handleError(getErr)
}
Expand Down

0 comments on commit d7cd2b1

Please sign in to comment.