(ctx context.Context, jobId string)
| 579 | } |
| 580 | |
| 581 | func CheckJobConnected(ctx context.Context, jobId string) (*waveobj.Job, error) { |
| 582 | job, err := wstore.DBMustGet[*waveobj.Job](ctx, jobId) |
| 583 | if err != nil { |
| 584 | return nil, fmt.Errorf("failed to get job: %w", err) |
| 585 | } |
| 586 | |
| 587 | isConnected, err := conncontroller.IsConnected(job.Connection) |
| 588 | if err != nil { |
| 589 | return nil, fmt.Errorf("error checking connection status: %w", err) |
| 590 | } |
| 591 | if !isConnected { |
| 592 | return nil, fmt.Errorf("connection %q is not connected", job.Connection) |
| 593 | } |
| 594 | |
| 595 | jobConnStatus := GetJobConnStatus(jobId) |
| 596 | if jobConnStatus != JobConnStatus_Connected { |
| 597 | return nil, fmt.Errorf("job is not connected (status: %s)", jobConnStatus) |
| 598 | } |
| 599 | |
| 600 | return job, nil |
| 601 | } |
| 602 | |
| 603 | type StartJobParams struct { |
| 604 | ConnName string |
no test coverage detected