From 01ed2d9090db4685264cca09b7b484b62b7956f2 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Thu, 22 Feb 2018 15:12:04 -0600 Subject: [PATCH] Mejorar el tiempo para generar el PDF --- source/app/controllers/util.py | 6 ++---- source/app/main_debug.ini | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index 15dd742..ddd9f40 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -1109,6 +1109,7 @@ class LIBO(object): def pdf(self, path, data, ods=False): options = {'AsTemplate': True, 'Hidden': True} + log.info('Abrir plantilla...') self._template = self._doc_open(path, options) if self._template is None: return b'' @@ -1123,13 +1124,10 @@ class LIBO(object): _kill(path_ods) return data - doc = self._doc_open(path_ods, {'Hidden': True}) options = {'FilterName': 'calc_pdf_Export'} path_pdf = get_path_temp('.pdf') - doc.storeToURL(self._path_url(path_pdf), self._set_properties(options)) - doc.close(True) + self._template.storeToURL(self._path_url(path_pdf), self._set_properties(options)) self._template.close(True) - data = self._read(path_pdf) _kill(path_ods) _kill(path_pdf) diff --git a/source/app/main_debug.ini b/source/app/main_debug.ini index 2196794..e6090c5 100644 --- a/source/app/main_debug.ini +++ b/source/app/main_debug.ini @@ -8,4 +8,4 @@ threads = 4 py-autoreload = 1 thunder-lock = true static-map = /static=../static -http-timeout = 180 \ No newline at end of file +http-timeout = 300 \ No newline at end of file