It appears that the desired behavior here was to
throw an Exception if the job could not be found
in the queue two times in a row (after _notfound
reached 3). But because _notfound was reset to
zero every time in the loop, this condition was
never reached. So if the job was not in the queue,
wait would hang infinitely. This change moves
_notfound = 0 outside of the loop.
It appears that the desired behavior here was to throw an Exception if the job could not be found in the queue two times in a row (after _notfound reached 3). But because _notfound was reset to zero every time in the loop, this condition was never reached. So if the job was not in the queue, wait would hang infinitely. This change moves _notfound = 0 outside of the loop.