CLI 守护进程在启动时删除数据库条目: 当文件缓存部分加热时,初始扫描将被跳过

作者: nsanitas创建于 2026年8月27日更新于 2026年9月16日

1. The scan is skipped when the cache is non-emptysrc/apps/cli/adapters/NodeFileSystemAdapter.ts:

typescript
async getFiles(): Promise<NodeFile[]> {
    if (this.fileCache.size === 0) {
        await this.scanDirectory();
    }
    return Array.from(this.fileCache.values());
}

fileCache has two writers: scanDirectory() (full, recursive) and refreshFile(p) (one entry). A single refreshFile() call is enough to make the cache non-empty and suppress the initial scan permanently.

内容来源: vrtmrz/obsidian-livesync