Skip to content

Commit 07b2cfb

Browse files
committed
report
1 parent 236b67c commit 07b2cfb

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/c#/GeneralUpdate.Core/Configuration/ProcessInfo.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public ProcessInfo() { }
110110
/// <description><paramref name="updateVersions" />: Must not be null or an empty collection</description>
111111
/// </item>
112112
/// <item>
113-
/// <description><paramref name="reportUrl" />: Must not be null</description>
113+
/// <description><paramref name="reportUrl" />: Optional; status reporting is skipped when null or empty</description>
114114
/// </item>
115115
/// <item>
116116
/// <description><paramref name="backupDirectory" />: Must not be null</description>
@@ -145,7 +145,7 @@ public ProcessInfo() { }
145145
/// <exception cref="ArgumentNullException">
146146
/// Thrown when <paramref name="appName" />, <paramref name="installPath" />,
147147
/// <paramref name="currentVersion" />, <paramref name="lastVersion" />,
148-
/// <paramref name="appSecretKey" />, <paramref name="reportUrl" />, or
148+
/// <paramref name="appSecretKey" />, or
149149
/// <paramref name="backupDirectory" /> is <c>null</c>.
150150
/// </exception>
151151
/// <exception cref="ArgumentException">
@@ -198,7 +198,8 @@ public ProcessInfo(string appName
198198
UpdateVersions = updateVersions;
199199

200200
// Set report and backup parameters
201-
ReportUrl = reportUrl ?? throw new ArgumentNullException(nameof(reportUrl));
201+
// ReportUrl is optional — when not specified, no status reporting is performed.
202+
ReportUrl = reportUrl;
202203
BackupDirectory = backupDirectory ?? throw new ArgumentNullException(nameof(backupDirectory));
203204

204205
// Set optional parameters

src/c#/GeneralUpdate.Core/Network/VersionService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ public VersionService(IHttpAuthProvider? auth = null, TimeSpan? timeout = null,
176176
public static Task Report(string url, int recordId, int status, int? type,
177177
string scheme = null, string token = null, CancellationToken ct = default)
178178
{
179+
if (string.IsNullOrWhiteSpace(url))
180+
return Task.CompletedTask;
181+
179182
var a = _globalAuthProvider ?? HttpAuthProviderFactory.Create(scheme, token, null);
180183
return new VersionService(a).ReportAsync(url, recordId, status, type, ct);
181184
}

0 commit comments

Comments
 (0)