[Rt-commit] rtir branch, 2.9/avoid-unnecessary-constituency-loads, created. 3.0.0rc1-31-gacaec6f

Kevin Falcone falcone at bestpractical.com
Fri Jan 18 19:44:13 EST 2013


The branch, 2.9/avoid-unnecessary-constituency-loads has been created
        at  acaec6f4b285be9f29b1f06b14af6baa3017ef34 (commit)

- Log -----------------------------------------------------------------
commit acaec6f4b285be9f29b1f06b14af6baa3017ef34
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Jan 17 19:47:57 2013 -0500

    Avoid loading Constituencies on every ACL check in non-RTIR Queues.
    
    Because negative-caching of Constituency was disabled in
    1200cb1 this means that just listing the history of a simple ticket in
    the General queue could require hundreds of attempts to load the
    Constituency CF (which isn't applied) on any 3.8 instance.
    
    Luckily RT4 refactored HasRight and we cache the negative acl check
    better so this only happens a handful of times and isn't as noticeable.

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 49ca151..9251dbd 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -617,7 +617,10 @@ if ( RT::IR->HasConstituency ) {
 
         # We do this, rather than fall through to the orignal sub, as that
         # interacts poorly with our overloaded QueueObj below
-        if ( $self->CurrentUser->id == RT->SystemUser->id ) {
+        # Don't try and load Constituencies outside of RTIR.  It results
+        # in a lot of useless checks.
+        if ( ( $self->CurrentUser->id == RT->SystemUser->id ) ||
+             ( $queue->Name !~ /^(Incidents|Incident Reports|Investigations|Blocks)$/i ) ) {
             $_[-1] =  [$queue];
             return;
         }

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


More information about the Rt-commit mailing list