Instantiate OfficeConverter just once
This commit is contained in:
@@ -14,8 +14,7 @@ from converter.literals import TRANSFORMATION_RESIZE, \
|
|||||||
from converter.literals import DIMENSION_SEPARATOR
|
from converter.literals import DIMENSION_SEPARATOR
|
||||||
from converter.literals import FILE_FORMATS
|
from converter.literals import FILE_FORMATS
|
||||||
from converter.utils import cleanup
|
from converter.utils import cleanup
|
||||||
from converter.office_converter import OfficeConverter
|
from converter.runtime import office_converter
|
||||||
|
|
||||||
|
|
||||||
HASH_FUNCTION = lambda x: hashlib.sha256(x).hexdigest()
|
HASH_FUNCTION = lambda x: hashlib.sha256(x).hexdigest()
|
||||||
|
|
||||||
@@ -52,7 +51,6 @@ def convert(input_filepath, output_filepath=None, cleanup_files=False, mimetype=
|
|||||||
if os.path.exists(output_filepath):
|
if os.path.exists(output_filepath):
|
||||||
return output_filepath
|
return output_filepath
|
||||||
|
|
||||||
office_converter = OfficeConverter()
|
|
||||||
office_converter.convert(input_filepath, mimetype=mimetype)
|
office_converter.convert(input_filepath, mimetype=mimetype)
|
||||||
if office_converter:
|
if office_converter:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from converter.office_converter import OfficeConverter
|
||||||
|
|
||||||
|
office_converter = OfficeConverter()
|
||||||
Reference in New Issue
Block a user