Skip to content

Commit

Permalink
Generate match report with puppeteer 20.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
axunonb committed Sep 22, 2024
1 parent 63e9215 commit d9453b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions League/Caching/ReportSheetCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ public async Task<Stream> GetOrCreatePdf(MatchReportSheetRow data, string html,
if (!File.Exists(cacheFile) || IsOutdated(cacheFile, data.ModifiedOn))
{
_logger.LogDebug("Create new match report for tenant '{Tenant}', match '{MatchId}'", _tenantContext.Identifier, data.Id);
cacheFile = await GetReportSheetChromium(data.Id, html, cancellationToken);
// GetReportSheetPuppeteer() still throws on production server
// cacheFile = await GetReportSheetChromium(data.Id, html, cancellationToken);
cacheFile = await GetReportSheetPuppeteer(data.Id, html, cancellationToken);
// GetReportSheetPuppeteer(...) still throws on production server
if (cacheFile == null) return Stream.Null;
}

Expand Down Expand Up @@ -119,7 +120,7 @@ private string GetPathToCacheFile(long matchId)
var options = new PuppeteerSharp.LaunchOptions
{
Headless = true,
Product = PuppeteerSharp.Product.Chrome,
Browser = PuppeteerSharp.SupportedBrowser.Chromium,
// Alternative: --use-cmd-decoder=validating
Args = new[]
{ "--no-sandbox", "--disable-gpu", "--disable-extensions", "--use-cmd-decoder=passthrough" },
Expand Down
2 changes: 1 addition & 1 deletion League/League.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Localizations for English and German are included. The library is in operation o
<PackEmbeddedResource>true</PackEmbeddedResource>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PuppeteerSharp" Version="9.1.0" />
<PackageReference Include="PuppeteerSharp" Version="20.0.2" />
<PackageReference Include="StackifyMiddleware" Version="3.3.3.4767" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
Expand Down

0 comments on commit d9453b7

Please sign in to comment.