handle terminated job requests (#3948)

This commit is contained in:
Paul Wells
2025-09-23 23:54:01 -07:00
committed by GitHub
parent 49f9b9c8bd
commit 56ee23282f
2 changed files with 25 additions and 17 deletions
+6
View File
@@ -362,6 +362,12 @@ func (w *Worker) AssignJob(ctx context.Context, job *livekit.Job) (*livekit.JobS
// See handleAvailability for the response
select {
case res := <-availCh:
if res.Terminate {
job.State.EndedAt = now.UnixNano()
job.State.Status = livekit.JobStatus_JS_SUCCESS
return job.State, nil
}
if !res.Available {
return nil, ErrWorkerNotAvailable
}