Skip to content
This repository
Browse code

Dialing back the download status updates from 10 seconds to 5 minutes…

…. Ignoring pending downloads on the stats display. Both in an effort to reduce the load we're putting on ourselves.
  • Loading branch information...
commit 98268b8e35ffab06d4af8c1a104844b558d2060d 1 parent f09a380
Jeff Handley authored
2  Website/App_Start/AppActivator.cs
@@ -57,7 +57,7 @@ private static void AppPostStart()
57 57
         private static void BackgroundJobsPostStart()
58 58
         {
59 59
             var jobs = new IJob[] { 
60  
-                new UpdateStatisticsJob(TimeSpan.FromSeconds(10), () => new EntitiesContext(), timeout: TimeSpan.FromMinutes(5)),
  60
+                new UpdateStatisticsJob(TimeSpan.FromMinutes(5), () => new EntitiesContext(), timeout: TimeSpan.FromMinutes(5)),
61 61
                 new WorkItemCleanupJob(TimeSpan.FromDays(1), () => new EntitiesContext(), timeout: TimeSpan.FromDays(4)),
62 62
                 new LuceneIndexingJob(TimeSpan.FromMinutes(10), timeout: TimeSpan.FromMinutes(2)),
63 63
             };
7  Website/Services/AggregateStatsService.cs
@@ -15,12 +15,7 @@ public AggregateStats GetAggregateStats()
15 15
                     (Select Count([Key]) from PackageRegistrations pr 
16 16
                             where exists (Select 1 from Packages p where p.PackageRegistrationKey = pr.[Key] and p.Listed = 1)) as UniquePackages,
17 17
                     (Select Count([Key]) from Packages where Listed = 1) as TotalPackages,
18  
-                    (
19  
-                        (Select Sum(DownloadCount) from Packages) + 
20  
-                        (Select Count([Key]) from PackageStatistics where [Key] > 
21  
-                            (Select DownloadStatsLastAggregatedId FROM GallerySettings)
22  
-                        )
23  
-                    ) as DownloadCount";
  18
+                    (Select Sum(DownloadCount) from Packages) as DownloadCount";
24 19
                     
25 20
                     database.Connection.Open();
26 21
                     using (var reader = command.ExecuteReader(CommandBehavior.CloseConnection | CommandBehavior.SingleRow))

0 notes on commit 98268b8

Please sign in to comment.
Something went wrong with that request. Please try again.