mirror of
https://github.com/NixOS/nix.git
synced 2025-12-14 13:01:05 +01:00
Merge pull request #14368 from NixOS/keep-tarball-cache-open
Move getTarballCache() into fetchers::Settings
This commit is contained in:
commit
070e8ee590
5 changed files with 29 additions and 13 deletions
|
|
@ -1328,13 +1328,18 @@ std::vector<std::tuple<GitRepoImpl::Submodule, Hash>> GitRepoImpl::getSubmodules
|
|||
return result;
|
||||
}
|
||||
|
||||
ref<GitRepo> getTarballCache()
|
||||
{
|
||||
static auto repoDir = std::filesystem::path(getCacheDir()) / "tarball-cache";
|
||||
namespace fetchers {
|
||||
|
||||
return GitRepo::openRepo(repoDir, true, true);
|
||||
ref<GitRepo> Settings::getTarballCache() const
|
||||
{
|
||||
auto tarballCache(_tarballCache.lock());
|
||||
if (!*tarballCache)
|
||||
*tarballCache = GitRepo::openRepo(std::filesystem::path(getCacheDir()) / "tarball-cache", true, true);
|
||||
return ref<GitRepo>(*tarballCache);
|
||||
}
|
||||
|
||||
} // namespace fetchers
|
||||
|
||||
GitRepo::WorkdirInfo GitRepo::getCachedWorkdirInfo(const std::filesystem::path & path)
|
||||
{
|
||||
static Sync<std::map<std::filesystem::path, WorkdirInfo>> _cache;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue