Skip to content

Commit

Permalink
enable parallel execution of cache using tools
Browse files Browse the repository at this point in the history
The old cache implementation did not handle parallel
execution of tools (e..g initrd and boot generator) very well.
It could corrupt the cache index and even the packages.

This new implementation uses an sqlite database to allow
concurrent read access and synchronized write access to the index.
A package can now only be added once to the index. If a second process
tries to add it, it is just ignored.

Aditionally the cache can be recovered from the  package files stored in the
cache directory if the index does not exist or is corrupted.
  • Loading branch information
MofX committed Jan 14, 2025
1 parent 5bba7bd commit 20a75ca
Show file tree
Hide file tree
Showing 35 changed files with 734 additions and 217 deletions.
2 changes: 1 addition & 1 deletion ebcl/common/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AptCache:
"""
_cache_dir: Path

def __init__(self, cache_dir: Path):
def __init__(self, cache_dir: Path) -> None:
self._cache_dir = cache_dir
self._cache_dir.mkdir(parents=True, exist_ok=True)

Expand Down
Loading

0 comments on commit 20a75ca

Please sign in to comment.