start jobs with started state (#3070)
* start jobs with started state * deps
This commit is contained in:
+5
-4
@@ -336,12 +336,13 @@ func (w *Worker) AssignJob(ctx context.Context, job *livekit.Job) (*livekit.JobS
|
||||
w.mu.Unlock()
|
||||
}()
|
||||
|
||||
now := time.Now()
|
||||
if job.State == nil {
|
||||
job.State = &livekit.JobState{
|
||||
UpdatedAt: now.UnixNano(),
|
||||
}
|
||||
job.State = &livekit.JobState{}
|
||||
}
|
||||
now := time.Now()
|
||||
job.State.UpdatedAt = now.UnixNano()
|
||||
job.State.StartedAt = now.UnixNano()
|
||||
job.State.Status = livekit.JobStatus_JS_RUNNING
|
||||
|
||||
w.sendRequest(&livekit.ServerMessage{Message: &livekit.ServerMessage_Availability{
|
||||
Availability: &livekit.AvailabilityRequest{Job: job},
|
||||
|
||||
+1
-1
@@ -1010,7 +1010,7 @@ func (r *Room) DeleteAgentDispatch(dispatchID string) (*livekit.AgentDispatch, e
|
||||
r.lock.RUnlock()
|
||||
|
||||
for _, j := range jobs {
|
||||
state, err := r.agentClient.TerminateJob(context.Background(), j.Id, rpc.JobTerminateReason_TERINATION_REQUESTED)
|
||||
state, err := r.agentClient.TerminateJob(context.Background(), j.Id, rpc.JobTerminateReason_TERMINATION_REQUESTED)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user