diff --git a/src/borg/archive.py b/src/borg/archive.py index 2aac5afbe5..847f6992d5 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -1649,7 +1649,9 @@ def check( self.check_all = not any((first, last, match, older, newer, oldest, newest)) self.repair = repair self.repository = repository - self.chunks = build_chunkindex_from_repo(self.repository, disable_caches=True, cache_immediately=not repair) + # Repository.check already did a full repository-level check and has built and cached a fresh chunkindex - + # we can use that here, so we don't disable the caches (also no need to cache immediately, again): + self.chunks = build_chunkindex_from_repo(self.repository, disable_caches=False, cache_immediately=False) self.key = self.make_key(repository) self.repo_objs = RepoObj(self.key) if verify_data: diff --git a/src/borg/archiver/check_cmd.py b/src/borg/archiver/check_cmd.py index 27b8fd6c03..a7d0ea9900 100644 --- a/src/borg/archiver/check_cmd.py +++ b/src/borg/archiver/check_cmd.py @@ -41,6 +41,7 @@ def do_check(self, args, repository): raise CommandError("--undelete-archives requires --repair argument.") if args.max_duration and not args.repo_only: # when doing a partial repo check, we can only check xxh64 hashes in repository files. + # archives check requires that a full repo check was done before and has built/cached a ChunkIndex. # also, there is no max_duration support in the archives check code anyway. raise CommandError("--repository-only is required for --max-duration support.") if not args.archives_only: