Skip to content

Commit e6c7c0b

Browse files
authored
Support nullable download timeout option (#98)
Changed DownloadTimeOut option type to nullable int and updated usage to handle null values, allowing more flexible configuration of download timeout settings.
1 parent 43c59e6 commit e6c7c0b

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

-156 Bytes
Binary file not shown.

src/c#/GeneralUpdate.Common/Internal/Bootstrap/UpdateOption.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private class UpdateOptionPool : ConstantPool
3131
/// <summary>
3232
/// Timeout period (unit: second). If this parameter is not specified, the default timeout period is 30 seconds.
3333
/// </summary>
34-
public static readonly UpdateOption<int> DownloadTimeOut = ValueOf<int>("DOWNLOADTIMEOUT");
34+
public static readonly UpdateOption<int?> DownloadTimeOut = ValueOf<int?>("DOWNLOADTIMEOUT");
3535

3636
/// <summary>
3737
/// Whether to enable the driver upgrade function.

src/c#/GeneralUpdate.Core/GeneralUpdateBootstrap.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ private void ApplyRuntimeOptions()
247247
{
248248
_configInfo.Encoding = GetOption(UpdateOption.Encoding) ?? Encoding.Default;
249249
_configInfo.Format = GetOption(UpdateOption.Format) ?? Format.ZIP;
250-
var downloadTimeoutOption = GetOption(UpdateOption.DownloadTimeOut);
251-
_configInfo.DownloadTimeOut = downloadTimeoutOption ?? 60;
250+
_configInfo.DownloadTimeOut = GetOption(UpdateOption.DownloadTimeOut) ?? 60;
252251
_configInfo.DriveEnabled = GetOption(UpdateOption.Drive) ?? false;
253252
_configInfo.PatchEnabled = GetOption(UpdateOption.Patch) ?? true;
254253
}

0 commit comments

Comments
 (0)