Merge pull request #1808 from wabbajack-tools/retry-steam-calls

Add retry logic to GetAppManifest
This commit is contained in:
Timothy Baldridge 2022-01-10 20:57:57 -07:00 committed by GitHub
commit c16c9c83d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 16 deletions

View File

@ -7,7 +7,7 @@ on:
branches: [ main ]
env:
VERSION: 3.0.0.0-beta5
VERSION: 3.0.0.0-beta6
jobs:
build:

View File

@ -376,9 +376,12 @@ public class Client : IDisposable
public async Task<DepotManifest> GetAppManifest(uint appId, uint depotId, ulong manifestId)
{
await LoadCDNServers();
var client = _cdnServers.First();
var uri = new UriBuilder()
var manifest = await CircuitBreaker.WithAutoRetryAsync<DepotManifest, HttpRequestException>(_logger, async () =>
{
var client = _cdnServers.First();
var uri = new UriBuilder
{
Host = client.Host,
Port = client.Port,
@ -393,7 +396,9 @@ public class Client : IDisposable
var data = new MemoryStream();
await using var entryStream = firstEntry.Open();
await entryStream.CopyToAsync(data);
var manifest = DepotManifest.Deserialize(data.ToArray());
return DepotManifest.Deserialize(data.ToArray());
});
if (manifest.FilenamesEncrypted)
manifest.DecryptFilenames(await GetDepotKey(depotId, appId));