| 109 | } |
| 110 | |
| 111 | func (e *Executor) splitRegularAndWatchCalls(calls ...*Call) (regularCalls []*Call, watchCalls []*Call, err error) { |
| 112 | for _, c := range calls { |
| 113 | t, err := e.GetTask(c) |
| 114 | if err != nil { |
| 115 | return nil, nil, err |
| 116 | } |
| 117 | |
| 118 | if e.Watch || t.Watch { |
| 119 | watchCalls = append(watchCalls, c) |
| 120 | } else { |
| 121 | regularCalls = append(regularCalls, c) |
| 122 | } |
| 123 | } |
| 124 | return regularCalls, watchCalls, err |
| 125 | } |
| 126 | |
| 127 | // RunTask runs a task by its name |
| 128 | func (e *Executor) RunTask(ctx context.Context, call *Call) error { |