The home page stats, built by the get_activity drupalorg method, are extremely nasty queries. They should not be loaded by user traffic to prevent a poor user experience and the possibility of a stampede. Below is a small patch to add a drush command to rebuild these stats via cron:


=== modified file 'sites/all/modules/drupalorg/drupalorg/drupalorg.drush.inc'
--- sites/all/modules/drupalorg/drupalorg/drupalorg.drush.inc	2010-09-28 03:27:13 +0000
+++ sites/all/modules/drupalorg/drupalorg/drupalorg.drush.inc	2010-10-06 20:54:58 +0000
@@ -4,6 +4,8 @@
   switch ($section) {
     case 'drupalorg:map-content':
       return dt('Update home page map pins.');
+    case 'drupalorg:rebuild-stats':
+      return dt('Update home page stats.');
   }
 }
 
@@ -12,9 +14,17 @@
     'map-content' => array(
       'description' => 'Update home page map pins.',
     ),
+    'rebuild-stats' => array(
+      'description' => 'Update home page stats.',
+    ),
   );
 }
 
 function drush_drupalorg_map_content() {
   drupalorg_map_content(TRUE);
 }
+
+function drush_drupalorg_rebuild_stats() {
+  drupalorg_get_activity(TRUE);
+}
+

Comments

nnewton’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 1a8a449 on 6.x-3.x, 7.x-3.x-dev by nnewton:
    #933914 - by nnewton: Add a drush command to precalc the home page stats...