(ctx context.Context)
| 340 | } |
| 341 | |
| 342 | func (t *task) Wait(ctx context.Context) (<-chan ExitStatus, error) { |
| 343 | c := make(chan ExitStatus, 1) |
| 344 | go func() { |
| 345 | defer close(c) |
| 346 | ctx, span := tracing.StartSpan(ctx, "task.Wait", |
| 347 | tracing.WithAttribute("task.id", t.ID()), |
| 348 | ) |
| 349 | defer span.End() |
| 350 | r, err := t.client.TaskService().Wait(ctx, &tasks.WaitRequest{ |
| 351 | ContainerID: t.id, |
| 352 | }) |
| 353 | if err != nil { |
| 354 | c <- ExitStatus{ |
| 355 | code: UnknownExitStatus, |
| 356 | err: err, |
| 357 | } |
| 358 | return |
| 359 | } |
| 360 | |
| 361 | c <- ExitStatus{ |
| 362 | code: r.ExitStatus, |
| 363 | exitedAt: protobuf.FromTimestamp(r.ExitedAt), |
| 364 | } |
| 365 | }() |
| 366 | return c, nil |
| 367 | } |
| 368 | |
| 369 | // Delete deletes the task and its runtime state |
| 370 | // it returns the exit status of the task and any errors that were encountered |
nothing calls this directly
no test coverage detected