Skip to content

Commit

Permalink
fix: avoid re-extracting files
Browse files Browse the repository at this point in the history
  • Loading branch information
Crissium committed Nov 4, 2023
1 parent 4d898a1 commit bec1fd8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/app/dicts/dsl/markup_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(self, dict_filename: 'str', dict_name: 'str', resources_dir: 'str',
self._resources_dir = resources_dir

def _extract_files(self, files_to_be_extracted: 'list[str]') -> 'None':
files_to_be_extracted = [filename for filename in files_to_be_extracted if not os.path.join(self._resources_dir, filename)]
if not self._resources_extracted and files_to_be_extracted and self._resources_filename and os.path.isfile(self._resources_filename):
# ZipFile's extractall() is too slow, so we use a thread pool to extract files in parallel.
with ZipFile(self._resources_filename) as zip_file:
Expand Down

0 comments on commit bec1fd8

Please sign in to comment.