retry机制抛出异常
This commit is contained in:
@@ -3,19 +3,24 @@ package com.volvo.ai.analytic.center.service.impl;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.volvo.ai.analytic.center.dto.req.DiFyReq;
|
||||
import com.volvo.ai.analytic.center.service.DiFyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.retry.annotation.Backoff;
|
||||
import org.springframework.retry.annotation.Retryable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* dify调用retry
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class DiFyRetryImpl {
|
||||
|
||||
@Autowired
|
||||
private DiFyService diFyService;
|
||||
@Retryable(maxAttempts = 1, backoff = @Backoff(delay = 1000))
|
||||
public JSONObject getDiFyRetry(DiFyReq diFyReq) {
|
||||
|
||||
log.info("diFyService class: {}", diFyService.getClass());
|
||||
return (JSONObject) diFyService.getDiFyObjectRetry(diFyReq);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user