M2: local cache of pack indexes (ngb_index)
Opening a repository lists index/ once and downloads only index files that are not cached; packs written by this server are cached on write, stale cache rows are dropped. Each resumable step therefore no longer downloads every index file from the location.
This commit is contained in:
@@ -28,6 +28,7 @@ class TargetService {
|
||||
private KeyService $keys,
|
||||
private ICrypto $crypto,
|
||||
private IAppManager $appManager,
|
||||
private \OCA\NgBackup\Db\DbIndexCache $indexCache,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -98,7 +99,7 @@ class TargetService {
|
||||
}
|
||||
|
||||
public function repository(Target $target): Repository {
|
||||
$repo = Repository::openWithKey($this->backend($target), $this->keys->keyRing());
|
||||
$repo = Repository::openWithKey($this->backend($target), $this->keys->keyRing(), $this->indexCache);
|
||||
if ($target->getRepositoryId() !== null && $repo->id() !== $target->getRepositoryId()) {
|
||||
throw new \RuntimeException('The target now contains a different repository than when it was added');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user