file_manager: delay file observer initialization

The addition of "gcode file processors" makes it possible
for processor registration to occur in "component_init".
The file observer init must be delayed until after all processors
are registered to correctly process metadata for gcode files
added while Moonraker was not running.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan
2025-02-17 06:36:03 -05:00
parent 35cb7501c6
commit c35353ed2a
2 changed files with 10 additions and 1 deletions

View File

@@ -176,7 +176,7 @@ class FileManager:
if prune:
self.gcode_metadata.prune_storage()
async def component_init(self):
def start_file_observer(self):
self.fs_observer.initialize()
def _update_fixed_paths(self) -> None:
@@ -1889,6 +1889,8 @@ class InotifyObserver(BaseFileSystemObserver):
self._notify_root_updated, mevts, root, root_path)
def initialize(self) -> None:
if self.initialized:
return
for root, node in self.watched_roots.items():
try:
evts = node.scan_node()