fix: deduplicate isNaN check in wakeup sync validation

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/75b1b671-d7ed-465c-95e7-d04ac4ebb8ba
This commit is contained in:
copilot-swe-agent[bot] 2026-03-25 23:55:16 +00:00 committed by GitHub
parent 769575c885
commit dbd5b173c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -66,10 +66,11 @@ let syncStale = false;
if (notionSync) {
const lastSync = new Date(notionSync.last_sync_time);
if (isNaN(lastSync.getTime())) {
const validSyncTime = !isNaN(lastSync.getTime());
if (!validSyncTime) {
console.error('⚠️ notion_sync.last_sync_time 格式无效:', notionSync.last_sync_time);
}
const hoursSinceSync = isNaN(lastSync.getTime()) ? Infinity : (Date.now() - lastSync.getTime()) / (1000 * 60 * 60);
const hoursSinceSync = validSyncTime ? (Date.now() - lastSync.getTime()) / (1000 * 60 * 60) : Infinity;
syncStale = hoursSinceSync > 24;
// 强制检查清单 (§四)