Skip to content

Commit

Permalink
Sync tarball cache within tarball cache Activity
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Aug 28, 2024
1 parent 1a597b6 commit dc74ea1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/libfetchers/github.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,12 @@ struct GitArchiveInputScheme : InputScheme
auto tarballCache = getTarballCache();
auto parseSink = tarballCache->getFileSystemObjectSink();
auto lastModified = unpackTarfileToSink(archive, *parseSink);
auto tree = parseSink->sync();

act.reset();

TarballInfo tarballInfo {
.treeHash = tarballCache->dereferenceSingletonDirectory(parseSink->sync()),
.treeHash = tarballCache->dereferenceSingletonDirectory(tree),
.lastModified = lastModified
};

Expand Down
3 changes: 2 additions & 1 deletion src/libfetchers/tarball.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ static DownloadTarballResult downloadTarball_(
auto tarballCache = getTarballCache();
auto parseSink = tarballCache->getFileSystemObjectSink();
auto lastModified = unpackTarfileToSink(archive, *parseSink);
auto tree = parseSink->sync();

act.reset();

Expand All @@ -184,7 +185,7 @@ static DownloadTarballResult downloadTarball_(
} else {
infoAttrs.insert_or_assign("etag", res->etag);
infoAttrs.insert_or_assign("treeHash",
tarballCache->dereferenceSingletonDirectory(parseSink->sync()).gitRev());
tarballCache->dereferenceSingletonDirectory(tree).gitRev());
infoAttrs.insert_or_assign("lastModified", uint64_t(lastModified));
if (res->immutableUrl)
infoAttrs.insert_or_assign("immutableUrl", *res->immutableUrl);
Expand Down

0 comments on commit dc74ea1

Please sign in to comment.