Skip to content

Commit

Permalink
GetChromeVersions: Check for 75 new branch positions to find the snap…
Browse files Browse the repository at this point in the history
…shot
  • Loading branch information
radical committed Aug 17, 2023
1 parent 3ad4f96 commit 63561fd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/tasks/WasmBuildTasks/GetChromeVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ public class GetChromeVersions : MBU.Task
private const string s_depsUrlPrefix = $"https://omahaproxy.appspot.com/deps.json?version=";
private const int s_versionCheckThresholdDays = 1;

// start at the branch position found in all.json, and try to
// download chrome, and chromedriver. If not found, then try up to
// s_numBranchPositionsToTry lower versions
private const int s_numBranchPositionsToTry = 50;
private static readonly HttpClient s_httpClient = new();

public string Channel { get; set; } = "stable";
Expand All @@ -44,6 +40,11 @@ public class GetChromeVersions : MBU.Task

public int MaxMajorVersionsToCheck { get; set; } = 2;

// start at the branch position found in all.json, and try to
// download chrome, and chromedriver. If not found, then try up to
// MaxBranchPositionsToCheck lower versions
public int MaxBranchPositionsToCheck { get; set; } = 75;

[Output]
public string ChromeVersion { get; set; } = string.Empty;
[Output]
Expand Down Expand Up @@ -240,7 +241,7 @@ private async Task<Stream> GetDownloadFileStreamAsync(string filename, string ur
string baseUrl = $"{s_snapshotBaseUrl}/{OSPrefix}";

int branchPosition = int.Parse(version.branch_base_position);
for (int i = 0; i < s_numBranchPositionsToTry; i++)
for (int i = 0; i < MaxBranchPositionsToCheck; i++)
{
string branchUrl = $"{baseUrl}/{branchPosition}";
string url = $"{branchUrl}/REVISIONS";
Expand Down

0 comments on commit 63561fd

Please sign in to comment.