om4r932 commited on
Commit
63e193c
·
1 Parent(s): fd28bbf

Add timeout

Browse files
Files changed (1) hide show
  1. spec_indexer.py +5 -1
spec_indexer.py CHANGED
@@ -83,8 +83,12 @@ def get_text(specification: str, version: str, second: bool = False):
83
  subprocess.run(
84
  ["libreoffice", "--headless", "--convert-to", "txt:Text", "--outdir", output_path, input_path],
85
  check=True,
86
- capture_output=True
 
87
  )
 
 
 
88
  except subprocess.CalledProcessError as e:
89
  print(f"\n[ERREUR] LibreOffice a échoué : {e}", flush=True)
90
  return []
 
83
  subprocess.run(
84
  ["libreoffice", "--headless", "--convert-to", "txt:Text", "--outdir", output_path, input_path],
85
  check=True,
86
+ capture_output=True,
87
+ timeout=60*10
88
  )
89
+ except subprocess.TimeoutExpired as e:
90
+ print("[SKIP] Trop long !")
91
+ return []
92
  except subprocess.CalledProcessError as e:
93
  print(f"\n[ERREUR] LibreOffice a échoué : {e}", flush=True)
94
  return []