added "when_to_run" parameter in worker retry method