diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -181,12 +181,15 @@ void mortition(struct distrenjob *head, } } - if(isJobDone) + if(isJobDone) // if all frames were accounted for { distrenjob_remove(head, job); distrenjob_free(&job); general_info.jobs_in_queue--; } + else{ + job->prev_frame_index = 0; // if the job isn't done, have frame_finder() start from the first frame, allowing it to see the frames that are now unassigned + } } /** @@ -298,7 +301,7 @@ int find_jobframe(struct distrenjob *hea found = 0; /* iterate through jobs from first to last */ for(distrenjob_ptr = head->next; (!found && !distrenjob_ptr) && !distrenjob_ptr->hibernate; distrenjob_ptr = distrenjob_ptr->next) - for(frame_counter = 0; !found && frame_counter < distrenjob_ptr->total_frames; frame_counter ++) + for(frame_counter = distrenjob_ptr->prev_frame_index; !found && frame_counter < distrenjob_ptr->total_frames; frame_counter ++) if(distrenjob_ptr->frameset[frame_counter].status == FRAMESETSTATUS_UNASSIGNED) { found = 1;