(ctx context.Context, taskID string)
| 672 | } |
| 673 | |
| 674 | func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error) { |
| 675 | d.logger.Info("WaitTask", "taskID", taskID) |
| 676 | handle, ok := d.tasks.Get(taskID) |
| 677 | if !ok { |
| 678 | return nil, drivers.ErrTaskNotFound |
| 679 | } |
| 680 | |
| 681 | ch := make(chan *drivers.ExitResult) |
| 682 | go d.handleWait(ctx, handle, ch) |
| 683 | |
| 684 | return ch, nil |
| 685 | } |
| 686 | |
| 687 | func (d *Driver) handleWait(ctx context.Context, handle *taskHandle, ch chan *drivers.ExitResult) { |
| 688 | defer close(ch) |
nothing calls this directly
no test coverage detected