[Rt-commit] rtir branch, 2.6/avoid-unnecessary-constituency-loads, created. 2.6.2rc1-12-g7219cb0

Kevin Falcone falcone at bestpractical.com
Thu Jan 17 20:20:24 EST 2013


The branch, 2.6/avoid-unnecessary-constituency-loads has been created
        at  7219cb030779004e5d034b66c12a9a8e16ec3487 (commit)

- Log -----------------------------------------------------------------
commit 7219cb030779004e5d034b66c12a9a8e16ec3487
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 f7e2eeb..1e844ca 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -598,7 +598,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