Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ getline
github
githubusercontent
globals
hardlink
hfile
HGLOBAL
HIDECANCEL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ namespace AppInstaller::CLI::Workflow
if (retry)
{
std::this_thread::sleep_for(250ms);
// If it fails again, let that one throw
std::filesystem::rename(installerPath, renamedDownloadedInstaller);
// If retry fails, try copying with hardlink. The file at installerPath will not be cleaned up after installation,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retry

if rename fails?

// but it is in a temp folder.
std::filesystem::copy(installerPath, renamedDownloadedInstaller, std::filesystem::copy_options::create_hard_links);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking to make it retry every 100ms for 500ms, and only then copy. Since the file won't get cleaned up we would really prefer the rename.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.

}

installerPath.assign(renamedDownloadedInstaller);
Expand Down