Executor is the task executor.
| 13 | |
| 14 | // Executor is the task executor. |
| 15 | type Executor interface { |
| 16 | // RunOnce will be called once by the scheduler to execute the task. |
| 17 | // If err is non-nil, the task will be marked as failed. |
| 18 | // driverCtx is used by the database driver so that we can cancel the query |
| 19 | // while having the ability to cleanup migration history etc. |
| 20 | RunOnce(ctx context.Context, driverCtx context.Context, task *store.TaskMessage, taskRunUID int64) (result *storepb.TaskRunResult, err error) |
| 21 | } |
| 22 | |
| 23 | // RunExecutorOnce wraps a TaskExecutor.RunOnce call with panic recovery. |
| 24 | func RunExecutorOnce(ctx context.Context, driverCtx context.Context, exec Executor, task *store.TaskMessage, taskRunUID int64) (result *storepb.TaskRunResult, err error) { |