Skip to content

Commit

Permalink
Show when we're unpacking an archive into the Git cache
Browse files Browse the repository at this point in the history
This happens in parallel with the download (which starts later), so
you only see this message when the download has finished but the
import hasn't.
  • Loading branch information
edolstra committed Jul 24, 2024
1 parent f6a9a71 commit 01839b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libfetchers/github.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,15 @@ struct GitArchiveInputScheme : InputScheme
getFileTransfer()->download(std::move(req), sink);
});

auto act = std::make_unique<Activity>(*logger, lvlInfo, actUnknown,
fmt("unpacking '%s' into the Git cache", input.to_string()));

TarArchive archive { *source };
auto parseSink = getTarballCache()->getFileSystemObjectSink();
auto lastModified = unpackTarfileToSink(archive, *parseSink);

act.reset();

TarballInfo tarballInfo {
.treeHash = parseSink->sync(),
.lastModified = lastModified
Expand Down
5 changes: 5 additions & 0 deletions src/libfetchers/tarball.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ DownloadTarballResult downloadTarball(

// TODO: fall back to cached value if download fails.

auto act = std::make_unique<Activity>(*logger, lvlInfo, actUnknown,
fmt("unpacking '%s' into the Git cache", url));

AutoDelete cleanupTemp;

/* Note: if the download is cached, `importTarball()` will receive
Expand All @@ -167,6 +170,8 @@ DownloadTarballResult downloadTarball(
auto parseSink = getTarballCache()->getFileSystemObjectSink();
auto lastModified = unpackTarfileToSink(archive, *parseSink);

act.reset();

auto res(_res->lock());

Attrs infoAttrs;
Expand Down

0 comments on commit 01839b5

Please sign in to comment.