diff --git a/backend/server.js b/backend/server.js index a99c6c0..ca54bd6 100644 --- a/backend/server.js +++ b/backend/server.js @@ -1790,9 +1790,15 @@ async function runDownloadTrafficLogReconcile(trigger = 'interval') { const processed = DownloadTrafficIngestDB.isProcessed(ingestConfig.bucket, key, etag); if (processed) continue; - // 仅处理常见日志文件后缀 + // 兼容无后缀日志(阿里云 OSS 默认日志文件通常没有 .log 后缀) + if (key.endsWith('/')) { + continue; + } const lowerKey = key.toLowerCase(); - if (!lowerKey.endsWith('.log') && !lowerKey.endsWith('.txt') && !lowerKey.endsWith('.gz')) { + const hasKnownLogExt = lowerKey.endsWith('.log') || lowerKey.endsWith('.txt') || lowerKey.endsWith('.gz'); + const hasLogLikeToken = lowerKey.includes('traffic') || lowerKey.includes('access') || lowerKey.includes('log'); + // 当前缀未配置时,避免误扫整桶普通业务对象 + if (!ingestConfig.prefix && !hasKnownLogExt && !hasLogLikeToken) { continue; }