Add timeout to Report.convert
issue7972 review50691002
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Add timeout to Report.convert
|
||||
* Allow records from XML with noupdate to be deleted
|
||||
* Add ir.calendar for month and day
|
||||
* Rename languages: hu_HU, it_IT and pt_BR into hu, it and pt
|
||||
|
||||
@@ -296,7 +296,7 @@ class Report(URLMixin, PoolBase):
|
||||
return data
|
||||
|
||||
@classmethod
|
||||
def convert(cls, report, data):
|
||||
def convert(cls, report, data, timeout=5 * 60):
|
||||
"converts the report data to another mimetype if necessary"
|
||||
input_format = report.template_extension
|
||||
output_format = report.extension or report.template_extension
|
||||
@@ -315,7 +315,7 @@ class Report(URLMixin, PoolBase):
|
||||
'--headless', '--nolockcheck', '--nodefault', '--norestore',
|
||||
'--convert-to', oext, '--outdir', dtemp, path]
|
||||
output = os.path.splitext(path)[0] + os.extsep + oext
|
||||
subprocess.check_call(cmd)
|
||||
subprocess.check_call(cmd, timeout=timeout)
|
||||
if os.path.exists(output):
|
||||
with open(output, 'rb') as fp:
|
||||
return oext, fp.read()
|
||||
|
||||
Reference in New Issue
Block a user