mirror of
https://github.com/hotyue/IP-Sentinel.git
synced 2026-09-07 00:17:27 +08:00
fix(core): 优化战报日志提取逻辑,改用精确截断替代全量扫描,大幅降低 I/O 消耗
This commit is contained in:
+2
-2
@@ -89,8 +89,8 @@ case "$REGION_CODE" in
|
|||||||
*) FLAG="🌐" ;;
|
*) FLAG="🌐" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# 3. 截取过去 24 小时的日志
|
# 3. 截取过去 24 小时的日志 (每天48次轮询,保留最新 1000 行足以覆盖单日战报)
|
||||||
LOG_CONTENT=$(find "$LOG_FILE" -mtime -1 -exec cat {} \; 2>/dev/null)
|
LOG_CONTENT=$(tail -n 1000 "$LOG_FILE" 2>/dev/null)
|
||||||
|
|
||||||
if [ -z "$LOG_CONTENT" ]; then
|
if [ -z "$LOG_CONTENT" ]; then
|
||||||
read -r -d '' MSG <<EOT
|
read -r -d '' MSG <<EOT
|
||||||
|
|||||||
Reference in New Issue
Block a user