* @zh 检查Scene是否可以被自动清理 * @en Check if a scene is eligible for auto cleanup
(sceneName: string, scene: IScene)
| 487 | * @en Check if a scene is eligible for auto cleanup |
| 488 | */ |
| 489 | private _isSceneCleanupCandidate(sceneName: string, scene: IScene): boolean { |
| 490 | const elapsed = Date.now() - this._createdAt; |
| 491 | return !this._activeScenes.has(sceneName) && |
| 492 | scene.entities != null && |
| 493 | scene.entities.count === 0 && |
| 494 | elapsed > this._config.cleanupThresholdMs!; |
| 495 | } |
| 496 | |
| 497 | /** |
| 498 | * @zh 执行自动清理操作 |