Skip to content

Commit

Permalink
Added more connection timeout logic to GetPackage
Browse files Browse the repository at this point in the history
  • Loading branch information
analogrelay committed Feb 3, 2014
1 parent 563cf10 commit 0926f47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/NuGetGallery/Controllers/ApiController.cs
Expand Up @@ -96,6 +96,9 @@ public virtual async Task<ActionResult> GetPackage(string id, string version)
// The allow prerelease flag is ignored if both partialId and version are specified.
// In general we want to try to add download statistics for any package regardless of whether a version was specified.

// Only allow database requests to take up to 5 seconds. Any longer and we just lose the data; oh well.
EntitiesContext.SetCommandTimeout(5);

Package package = null;
try
{
Expand All @@ -118,9 +121,6 @@ public virtual async Task<ActionResult> GetPackage(string id, string version)
ProjectGuids = Request.Headers["NuGet-ProjectGuids"],
};

// Only allow this to take up to 5 seconds. Any longer and we just lose the data; oh well.
EntitiesContext.SetCommandTimeout(5);

PackageService.AddDownloadStatistics(stats);
}
catch (ReadOnlyModeException)
Expand Down

0 comments on commit 0926f47

Please sign in to comment.