Make max retry count configurable