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:
SlimusMinus
2026-10-20 01:04:30 +03:00
parent a909b1f08b
commit 3fd045131c
4 changed files with 15 additions and 5 deletions

View File

@@ -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");