Skip to content

Commit

Permalink
module: file_manager
Browse files Browse the repository at this point in the history
Allow default metadata parser timeout to be configurable

Signed-off-by: Paul Morgan [email protected]
  • Loading branch information
moggieuk authored and Arksine committed Jun 23, 2024
1 parent 346a3d7 commit 4d6037c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions moonraker/components/file_manager/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,8 @@ def __init__(self,
self.server = config.get_server()
self.enable_object_proc = config.getboolean(
'enable_object_processing', False)
self.default_metadata_parser_timeout = config.getfloat(
'default_metadata_parser_timeout', 20.)
self.gc_path = ""
db.register_local_namespace(METADATA_NAMESPACE)
self.mddb = db.wrap_namespace(
Expand Down Expand Up @@ -2545,13 +2547,13 @@ async def _run_extract_metadata(self,
filename = filename.replace("\"", "\\\"")
cmd = " ".join([sys.executable, METADATA_SCRIPT, "-p",
self.gc_path, "-f", f"\"{filename}\""])
timeout = 10.
timeout = self.default_metadata_parser_timeout
if ufp_path is not None and os.path.isfile(ufp_path):
timeout = 300.
timeout = max(timeout, 300.)
ufp_path.replace("\"", "\\\"")
cmd += f" -u \"{ufp_path}\""
if self.enable_object_proc:
timeout = 300.
timeout = max(timeout, 300.)
cmd += " --check-objects"
result = bytearray()
sc: SCMDComp = self.server.lookup_component('shell_command')
Expand Down

0 comments on commit 4d6037c

Please sign in to comment.