Permalink
Browse files

Added more connection timeout logic to GetPackage

  • Loading branch information...
1 parent 563cf10 commit 0926f47396ed647305c6c7963c0b7865e41af0f2 @anurse anurse committed Feb 3, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/NuGetGallery/Controllers/ApiController.cs
@@ -96,6 +96,9 @@ public partial class ApiController : AppController
// 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
{
@@ -118,9 +121,6 @@ public partial class ApiController : AppController
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)

0 comments on commit 0926f47

Please sign in to comment.