return copy of job state when starting job (#3035)

This commit is contained in:
Paul Wells
2024-09-22 23:37:06 -07:00
committed by GitHub
parent 341d1e512c
commit 5e3b3ee3c1
2 changed files with 15 additions and 11 deletions
+2 -2
View File
@@ -366,7 +366,7 @@ func (h *AgentHandler) JobRequest(ctx context.Context, job *livekit.Job) (*rpc.J
values = append(values, "participant", job.Participant.Identity)
}
h.logger.Debugw("assigning job", values...)
err = selected.AssignJob(ctx, job)
state, err := selected.AssignJob(ctx, job)
if err != nil {
if errors.Is(err, agent.ErrWorkerNotAvailable) {
continue // Try another worker
@@ -383,7 +383,7 @@ func (h *AgentHandler) JobRequest(ctx context.Context, job *livekit.Job) (*rpc.J
}
return &rpc.JobRequestResponse{
State: job.State,
State: state,
}, nil
}
}