🔊 fix: Improve history message logging for timeout and limit exceed scenarios

This commit is contained in:
jarvis2f 2025-02-19 13:30:32 +08:00
parent 4a907a611d
commit 175a69a9b5

View file

@ -124,8 +124,12 @@ public class AutoDownloadVerticle extends AbstractVerticle {
private void addHistoryMessage(SettingAutoRecords.Item auto, long currentTimeMillis) {
log.debug("Start scan history! TelegramId: %d ChatId: %d FileType: %s".formatted(auto.telegramId, auto.chatId, auto.nextFileType));
if (System.currentTimeMillis() - currentTimeMillis > MAX_HISTORY_SCAN_TIME || isExceedLimit(auto.telegramId)) {
log.debug("Scan history end! TelegramId: %d ChatId: %d".formatted(auto.telegramId, auto.chatId));
if (System.currentTimeMillis() - currentTimeMillis > MAX_HISTORY_SCAN_TIME) {
log.debug("Scan history timeout! TelegramId: %d ChatId: %d".formatted(auto.telegramId, auto.chatId));
return;
}
if (isExceedLimit(auto.telegramId)) {
log.debug("Scan history exceed per telegram account limit! TelegramId: %d ChatId: %d".formatted(auto.telegramId, auto.chatId));
return;
}
Tuple2<String, List<String>> rule = handleRule(auto);