Skip to content

Commit dea514d

Browse files
authored
Fix timeout issue when downloading the exe file (#533)
1 parent c4b3b36 commit dea514d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

dotnet/src/build/GitHub.Copilot.SDK.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
<_CopilotArchivePath>$(_CopilotCacheDir)\copilot.tgz</_CopilotArchivePath>
6767
<_CopilotNormalizedRegistryUrl>$([System.String]::Copy('$(CopilotNpmRegistryUrl)').TrimEnd('/'))</_CopilotNormalizedRegistryUrl>
6868
<_CopilotDownloadUrl>$(_CopilotNormalizedRegistryUrl)/@github/copilot-$(_CopilotPlatform)/-/copilot-$(_CopilotPlatform)-$(CopilotCliVersion).tgz</_CopilotDownloadUrl>
69+
<!-- DownloadFile Timeout is in milliseconds; convert from user-facing seconds -->
70+
<_CopilotCliDownloadTimeoutMs>$([System.Convert]::ToInt32($([MSBuild]::Multiply($(CopilotCliDownloadTimeout), 1000))))</_CopilotCliDownloadTimeoutMs>
6971
</PropertyGroup>
7072

7173
<!-- Delete archive if binary missing (handles partial/corrupted downloads) -->
@@ -75,7 +77,7 @@
7577
<MakeDir Directories="$(_CopilotCacheDir)" Condition="!Exists('$(_CopilotCliBinaryPath)')" />
7678
<Message Importance="high" Text="Downloading Copilot CLI $(CopilotCliVersion) for $(_CopilotPlatform)..." Condition="!Exists('$(_CopilotCliBinaryPath)')" />
7779
<DownloadFile SourceUrl="$(_CopilotDownloadUrl)" DestinationFolder="$(_CopilotCacheDir)" DestinationFileName="copilot.tgz"
78-
Timeout="$([System.Int32]::Parse('$(CopilotCliDownloadTimeout)'))"
80+
Timeout="$(_CopilotCliDownloadTimeoutMs)"
7981
Condition="!Exists('$(_CopilotCliBinaryPath)')" />
8082

8183
<!-- Extract using tar (use Windows system tar explicitly to avoid Git bash tar issues) -->

0 commit comments

Comments
 (0)