ForceStop signals all goroutines to stop and prevents any further API calls back to coder server for this job
()
| 311 | |
| 312 | // ForceStop signals all goroutines to stop and prevents any further API calls back to coder server for this job |
| 313 | func (r *Runner) ForceStop() { |
| 314 | r.mutex.Lock() |
| 315 | defer r.mutex.Unlock() |
| 316 | r.stop() |
| 317 | if !r.okToSend { |
| 318 | return |
| 319 | } |
| 320 | r.okToSend = false |
| 321 | close(r.done) |
| 322 | // doesn't matter what we put here, since it won't get sent! Just need something to satisfy the condition in |
| 323 | // Start() |
| 324 | r.failedJob = &proto.FailedJob{} |
| 325 | r.cond.Signal() |
| 326 | } |
| 327 | |
| 328 | func (r *Runner) sendHeartbeat(ctx context.Context) (*proto.UpdateJobResponse, error) { |
| 329 | ctx, span := r.startTrace(ctx, "updateHeartbeat") |
no test coverage detected