Skip to content

Commit

Permalink
Fix potential timeout error on first job creation (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 authored Aug 11, 2023
1 parent 8b86b3c commit 00a5750
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions service/docker/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ func (s *JobService) CreateJob(cfg job.Config, onStopCb job.StopCb) (job.Job, er
return job.Job{}, fmt.Errorf("failed to update job runner: %w", err)
}

// We create a new context as updating the job runner could have taken more
// than dockerRequestTimeout.
ctx, cancel = context.WithTimeout(context.Background(), dockerRequestTimeout)
defer cancel()

var jobData recorder.RecorderConfig
jobData.FromMap(cfg.InputData)
jobData.SetDefaults()
Expand Down

0 comments on commit 00a5750

Please sign in to comment.