Add configurable retry count and wait time