[Rt-commit] rt branch, 3.9-fix-queue-caching, updated. rt-3.8.8-786-ga6834bd

Kevin Falcone falcone at bestpractical.com
Fri Sep 17 13:34:04 EDT 2010


The branch, 3.9-fix-queue-caching has been updated
       via  a6834bd1b71237561265ec52fdc07859ab3dbfa6 (commit)
       via  dc702cd508ffbeab7db3c8c42bf972e5d548c29b (commit)
      from  af31b175664257309cdb33e5111a988f206f5a35 (commit)

Summary of changes:
 lib/RT/Principal_Overlay.pm |    3 +++
 t/web/queue_caching.t       |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit dc702cd508ffbeab7db3c8c42bf972e5d548c29b
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Sep 17 11:40:07 2010 -0400

    Flush the queue cache if you grant or revoke SeeQueue

diff --git a/lib/RT/Principal_Overlay.pm b/lib/RT/Principal_Overlay.pm
index 65992b5..a0fbb6f 100755
--- a/lib/RT/Principal_Overlay.pm
+++ b/lib/RT/Principal_Overlay.pm
@@ -163,6 +163,8 @@ sub GrantRight {
 
     my $type = $self->_GetPrincipalTypeForACL();
 
+    RT->System->QueueCacheNeedsUpdate(1) if $args{'Right'} eq 'SeeQueue';
+
     # If it's a user, we really want to grant the right to their 
     # user equivalence group
     return $ace->Create(
@@ -216,6 +218,7 @@ sub RevokeRight {
         return (1);
     }
 
+    RT->System->QueueCacheNeedsUpdate(1) if $args{'Right'} eq 'SeeQueue';
     return ($status, $msg) unless $status;
     return $ace->Delete;
 }

commit a6834bd1b71237561265ec52fdc07859ab3dbfa6
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Sep 17 13:35:34 2010 -0400

    Work around caching in global objects
    
    Since $RT::System has a searchbuilder cache, when we fork for the test
    server, the old database handle is sanely re-opened, but any client
    attribute query will trip the old dbh which has already prepared a
    statement in Pg using the initial test script's PID.

diff --git a/t/web/queue_caching.t b/t/web/queue_caching.t
index 87e89fa..d12958c 100644
--- a/t/web/queue_caching.t
+++ b/t/web/queue_caching.t
@@ -8,6 +8,9 @@ my $original_test_queue = new_queue("Test$$");
 my ($baseurl, $m) = RT::Test->started_ok;
 ok $m->login, 'logged in';
 
+# the attribute cache hangs on to an old dbh
+delete $RT::System->{attributes};
+
 diag("Check for 2 existing queues being visible") if $ENV{TEST_VERBOSE};
 {
     check_queues();

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


More information about the Rt-commit mailing list