Skip to content

Commit

Permalink
Make expire fast for completed units (#440)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Francis Reizenstein <[email protected]>
  • Loading branch information
bottler and bottler authored Apr 21, 2021
1 parent 2067a75 commit 87b96a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mephisto/abstractions/providers/mturk/mturk_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ def expire(self) -> float:
otherwise just return the maximum assignment duration
"""
delay = 0
if self.get_status() == AssignmentState.ASSIGNED:
status = self.get_status()
if status in [AssignmentState.EXPIRED, AssignmentState.COMPLETED]:
return delay
if status == AssignmentState.ASSIGNED:
# The assignment is currently being worked on,
# so we will set the wait time to be the
# amount of time we granted for working on this assignment
Expand Down

0 comments on commit 87b96a0

Please sign in to comment.