[Rt-commit] rt branch, 4.4/serialize-json-initialdata, updated. rt-4.4.1-408-ga51767e

Shawn Moore shawn at bestpractical.com
Wed Mar 22 17:10:35 EDT 2017


The branch, 4.4/serialize-json-initialdata has been updated
       via  a51767e94efb3da8bba9a9314ee51db245852836 (commit)
      from  17fd33cd9599223ffb85b530297d6fcc497dc48e (commit)

Summary of changes:
 lib/RT/Queue.pm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit a51767e94efb3da8bba9a9314ee51db245852836
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Mar 22 20:58:07 2017 +0000

    Skip tickets ASAP as an optimization

diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index 4c2f5fb..5c51c5a 100644
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -1074,11 +1074,13 @@ sub FindDependencies {
                   VALUE    => 'RT::Queue-' );
     $deps->Add( in => $objs );
 
-    # Tickets
-    $objs = RT::Tickets->new( $self->CurrentUser );
-    $objs->Limit( FIELD => "Queue", VALUE => $self->Id );
-    $objs->{allow_deleted_search} = 1;
-    $deps->Add( in => $objs );
+    # Tickets (skipped early as an optimization)
+    if ($walker->{FollowTickets} || !defined($walker->{FollowTickets})) {
+        $objs = RT::Tickets->new( $self->CurrentUser );
+        $objs->Limit( FIELD => "Queue", VALUE => $self->Id );
+        $objs->{allow_deleted_search} = 1;
+        $deps->Add( in => $objs );
+    }
 
     # Object Custom Roles
     $objs = RT::ObjectCustomRoles->new( $self->CurrentUser );

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


More information about the rt-commit mailing list