[fix](binlog) Fix BinlogUtils getExpiredMs overflow (#22174)

This commit is contained in:
Jack Drogon
2023-07-26 15:15:34 +08:00
committed by GitHub
parent 6c0c66e664
commit af20d0c521

View File

@ -119,6 +119,10 @@ public class BinlogUtils {
public static long getExpiredMs(long ttlSeconds) {
long currentSeconds = System.currentTimeMillis() / 1000;
if (currentSeconds < ttlSeconds) {
return Long.MIN_VALUE;
}
long expireSeconds = currentSeconds - ttlSeconds;
return expireSeconds * 1000;
}