Updated rerun worker to check if rerun is allowed