Skip to content

Commit

Permalink
Reintroducing fs cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
theypsilon committed Sep 25, 2023
1 parent a2ebba5 commit 08fc37e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/downloader/file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ def is_file(self, path):
def is_folder(self, path):
return self._fs.is_folder(path)

def precache_is_file_with_folders(self, folders):
return self._fs.precache_is_file_with_folders(folders)

def download_target_path(self, path):
return self._fs.download_target_path(path)

Expand Down
4 changes: 4 additions & 0 deletions src/downloader/online_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def _unpack_dbs_data(self, importer_command, full_resync):

db_file_selector = _DatabaseFileSelector(resolved_db, read_only_store, full_resync, file_system, self._logger, self._base_session, self._free_space_reservation)

self._logger.bench('Precaching files...')
file_system.precache_is_file_with_folders(resolved_db.folders.keys())

self._logger.bench('Selecting changed files...')
changed_files, already_present_files, needed_zips = db_file_selector.select_changed_files()

Expand Down Expand Up @@ -268,6 +271,7 @@ def _remove_files(self, packages):
db_importer = _OnlineDatabaseImporter(db, write_only_store, read_only_store, externals, config, file_system, self._file_downloader_factory, self._logger, self._base_session, self._external_drives_repository)

db_importer.remove_deleted_files()
file_system.print_debug()

def _finish_stores(self, packages):
for db, config, store, _externals, _changed_files, _already_present_files, _needed_zips, filtered_zip_data, zip_summaries in packages:
Expand Down

0 comments on commit 08fc37e

Please sign in to comment.