Skip to content

[Feature] ProcessSnapshotProvider 重建时 metadataCache 丢失,建议单例化或提取缓存 #18

@ShadyUnderLight

Description

@ShadyUnderLight

要解决的问题

metadataCacheProcessSnapshotProvider 实例变量。如果 MonitorViewModel 重建了 ProcessSnapshotProvider 实例(如 viewModel 重载),cache 全丢,macOS 系统进程 PID 也会重新大量触发 NSRunningApplication 查询。

建议方案

ProcessSnapshotProvider 本身设计为全局单例 actor,或将 metadataCache 提取为独立 actor MetadataCache,在 App 生命周期内持久化。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions