Fix: Redispatch directly if possible (#169)

This commit is contained in:
Zebartin 2023-10-22 22:15:09 +08:00 committed by GitHub
parent db3e78498e
commit 9b853db955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,9 +105,6 @@ class Assignment(AssignmentClaim, SynthesizeUI):
for assignment in assignments: for assignment in assignments:
if assignment in self.dispatched: if assignment in self.dispatched:
continue continue
if remain <= 0:
yield assignment
continue
logger.hr('Assignment inlist', level=2) logger.hr('Assignment inlist', level=2)
logger.info(f'Check assignment inlist: {assignment}') logger.info(f'Check assignment inlist: {assignment}')
self.goto_entry(assignment) self.goto_entry(assignment)
@ -120,6 +117,9 @@ class Assignment(AssignmentClaim, SynthesizeUI):
self._get_assignment_time() self._get_assignment_time()
continue continue
# General assignments must be dispatchable here # General assignments must be dispatchable here
if remain <= 0:
yield assignment
continue
self.dispatch(assignment, duration) self.dispatch(assignment, duration)
remain -= 1 remain -= 1