Use ai.retry settings, add AI connect timeout, stop logging post text
AiRetryProperties was bound but @Retryable had hard-coded values, so ai.retry.* in application.yaml had no effect. WebClient had no connect timeout (Netty default 30 s per attempt). TextModerationProcessor logged the whole moderation context, including post text, at INFO. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,8 +21,10 @@ public class TextModerationClient {
|
||||
|
||||
@Retryable(
|
||||
retryFor = {AiUnavailableException.class, AiServerException.class, AiTimeoutException.class},
|
||||
maxAttempts = 3,
|
||||
backoff = @Backoff(delay = 500, multiplier = 2)
|
||||
// Параметры из ai.retry.* (AiRetryProperties); раньше они были захардкожены
|
||||
maxAttemptsExpression = "${ai.retry.max-attempts:3}",
|
||||
backoff = @Backoff(delayExpression = "${ai.retry.delay:500}",
|
||||
multiplierExpression = "${ai.retry.multiplier:2}")
|
||||
)
|
||||
public ModerationResponse moderate(String text) {
|
||||
log.info("Calling AI TextModeration service");
|
||||
|
||||
Reference in New Issue
Block a user