retry机制
This commit is contained in:
@@ -13,6 +13,8 @@ import com.volvo.ai.analytic.center.utils.AiAnalysisUtils;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.retry.annotation.Backoff;
|
||||||
|
import org.springframework.retry.annotation.Retryable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -49,6 +51,7 @@ public class DiFyServiceImpl implements DiFyService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Retryable(maxAttempts = 1, backoff = @Backoff(delay = 1000))
|
||||||
public Object getDiFyObjectRetry(DiFyReq diFyReq) {
|
public Object getDiFyObjectRetry(DiFyReq diFyReq) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("inputs",diFyReq.getInputs());
|
map.put("inputs",diFyReq.getInputs());
|
||||||
|
|||||||
Reference in New Issue
Block a user