(ctx context.Context, payload hookspkg.TaskRunEnqueuedPayload)
| 104 | } |
| 105 | |
| 106 | func (r *taskRoleRuntime) OnTaskRunEnqueued(ctx context.Context, payload hookspkg.TaskRunEnqueuedPayload) { |
| 107 | if r == nil { |
| 108 | return |
| 109 | } |
| 110 | if ctx == nil { |
| 111 | ctx = context.Background() |
| 112 | } else { |
| 113 | ctx = context.WithoutCancel(ctx) |
| 114 | } |
| 115 | runID := strings.TrimSpace(payload.RunID) |
| 116 | if runID == "" { |
| 117 | r.logTaskRoleError("daemon: task role enqueue payload missing run id", nil, payload) |
| 118 | return |
| 119 | } |
| 120 | run, err := r.store.GetTaskRun(ctx, runID) |
| 121 | if err != nil { |
| 122 | r.logTaskRoleError("daemon: load task run for role activation", err, payload) |
| 123 | return |
| 124 | } |
| 125 | taskRecord, err := r.store.GetTask(ctx, run.TaskID) |
| 126 | if err != nil { |
| 127 | r.logTaskRoleError("daemon: load task for role activation", err, payload) |
| 128 | return |
| 129 | } |
| 130 | if err := r.activateRun(ctx, taskRecord, run, taskRoleActivationReasonRunEnqueued); err != nil { |
| 131 | r.logTaskRoleError("daemon: activate task role session from enqueue", err, payload) |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | func (r *taskRoleRuntime) Recover(ctx context.Context) { |
| 136 | if r == nil { |
nothing calls this directly
no test coverage detected