Merge remote-tracking branch 'origin/main'

This commit is contained in:
root
2026-06-25 14:47:01 +08:00

View File

@@ -81,11 +81,11 @@ public class StreamTrimScheduler implements SmartLifecycle {
long maxlen = props.getTrim().getMaxlen(); long maxlen = props.getTrim().getMaxlen();
for (String stream : distinctStreams()) { for (String stream : distinctStreams()) {
try { try {
redis.execute((RedisCallback<Object>) connection -> connection.execute("XTRIM", redis.opsForStream().trim(stream,maxlen);
stream.getBytes(StandardCharsets.UTF_8), // redis.execute((RedisCallback<Object>) connection -> connection.execute("XTRIM",
"MAXLEN".getBytes(StandardCharsets.UTF_8), // stream.getBytes(StandardCharsets.UTF_8),
"~".getBytes(StandardCharsets.UTF_8), // "MAXLEN".getBytes(StandardCharsets.UTF_8),
String.valueOf(maxlen).getBytes(StandardCharsets.UTF_8))); // String.valueOf(maxlen).getBytes(StandardCharsets.UTF_8)));
} catch (Exception e) { } catch (Exception e) {
log.warn("[redis-stream] trim failed stream={}", stream, e); log.warn("[redis-stream] trim failed stream={}", stream, e);
} }