[Rt-commit] rt branch, 4.2/optimize-homepage-upgrade, created. rt-4.1.13-43-g2fc3931

Alex Vandiver alexmv at bestpractical.com
Tue Jul 2 12:14:53 EDT 2013


The branch, 4.2/optimize-homepage-upgrade has been created
        at  2fc3931504b0e5e2a1659e21f1eedcbb7b041969 (commit)

- Log -----------------------------------------------------------------
commit 2fc3931504b0e5e2a1659e21f1eedcbb7b041969
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Jul 2 11:46:59 2013 -0400

    Only iterate through User objects with HomepageSettings
    
    Otherwise, we make a query for the attributes of every user in the
    system, one at a time.

diff --git a/etc/upgrade/4.1.0/content b/etc/upgrade/4.1.0/content
index 47a3c7a..2a02c68 100644
--- a/etc/upgrade/4.1.0/content
+++ b/etc/upgrade/4.1.0/content
@@ -4,7 +4,22 @@ use warnings;
 our @Initial = (
     sub {
         my $users = RT::Users->new(RT->SystemUser);
-        $users->UnLimit;
+        my $attributes = $users->Join(
+            ALIAS1 => "main",
+            FIELD1 => "id",
+            TABLE2 => "Attributes",
+            FIELD2 => "ObjectId",
+        );
+        $users->Limit(
+            ALIAS => $attributes,
+            FIELD => "ObjectType",
+            VALUE => "RT::User",
+        );
+        $users->Limit(
+            ALIAS => $attributes,
+            FIELD => "Name",
+            VALUE => RT::User::_PrefName('HomepageSettings'),
+        );
 
         while (my $user = $users->Next) {
             my $settings = $user->Preferences('HomepageSettings')

-----------------------------------------------------------------------


More information about the Rt-commit mailing list