奈學(xué)p6p7大前端架構(gòu)師
? ? .withWaitStrategy(WaitStrategies.fixedWait(3, TimeUnit.SECONDS)) //設(shè)置等待間隔時(shí)間
? ? ? ? ? ?.withStopStrategy(StopStrategies.stopAfterAttempt(3)) //設(shè)置最大重試次數(shù)
? ? ? ? ? ?.build();
? ?try {
? ? ?retryer.call(() -> RetryDemoTask.retryTask("abc"));
? ?} catch (Exception e) {
? ? ?e.printStackTrace();
? ?}
標(biāo)簽: