mirror of
https://github.com/NixOS/nix.git
synced 2025-12-03 15:40:59 +01:00
Move getTarballCache() into fetchers::Settings
This keeps the tarball cache open across calls.
This commit is contained in:
parent
bef3c37cb2
commit
bc6b9cef51
5 changed files with 29 additions and 13 deletions
|
|
@ -1304,13 +1304,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