Skip to content

Commit

Permalink
Fix instance creation timeout
Browse files Browse the repository at this point in the history
Signed-off-by: ekko <lihai.tu@daocloud.io>
  • Loading branch information
0ekk committed Feb 21, 2025
1 parent 0933be9 commit c4ab059
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/services/ecs/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ func (s *Service) CheckJob(jobId string) error {
JobId: jobId,
}

timeout := time.After(time.Minute)
wait := 2 * time.Minute
timeout := time.After(wait)
for {
resp, err := s.ECSClient.ShowJob(req)
if err != nil {
Expand All @@ -376,7 +377,7 @@ func (s *Service) CheckJob(jobId string) error {
case ecsModel.GetShowJobResponseStatusEnum().INIT, ecsModel.GetShowJobResponseStatusEnum().RUNNING:
select {
case <-timeout:
return fmt.Errorf("job timed out after 1 minute")
return fmt.Errorf("job timed out after %d seconds", wait)
case <-time.After(1 * time.Second):
continue
}
Expand Down

0 comments on commit c4ab059

Please sign in to comment.