Skip to content

Commit

Permalink
Merge pull request #15 from Real-Serious-Games/update-cache-request-t…
Browse files Browse the repository at this point in the history
…imeout

Increases file download request timeout to 5 seconds - fixed #13
  • Loading branch information
floydpink authored Sep 18, 2020
2 parents 51cac51 + 9b76a4e commit c60cf9c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/FileCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public enum CacheMode
// Record whether a file is being written.
private static readonly Dictionary<string, bool> IsWritingFile = new Dictionary<string, bool>();

// Timeout for performing the file download request.
private static readonly int RequestTimeout = TimeSpan.FromSeconds(5).Milliseconds;

static FileCache()
{
// default cache directory - can be changed if needed from App.xaml
Expand Down Expand Up @@ -74,7 +77,7 @@ public static async Task<MemoryStream> HitAsync(string url)
}

var request = WebRequest.Create(uri);
request.Timeout = 30;
request.Timeout = RequestTimeout;
try
{
var response = await request.GetResponseAsync();
Expand Down

0 comments on commit c60cf9c

Please sign in to comment.