Is there a way you can accomplish this without adding this second positional arg to the public interface?

I can't see a reason that the next six lines (the two if blocks) need to be executed on each retry.