[Jifty-commit] r5985 - in jifty/trunk: lib lib/Jifty

Jifty commits jifty-commit at lists.jifty.org
Mon Nov 10 14:33:02 EST 2008


Author: alexmv
Date: Mon Nov 10 14:33:02 2008
New Revision: 5985

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty.pm
   jifty/trunk/lib/Jifty/Test.pm

Log:
 r38975 at kohr-ah:  chmrr | 2008-11-07 15:14:16 -0500
  * Don't connect to Pubsub during cleanup


Modified: jifty/trunk/lib/Jifty.pm
==============================================================================
--- jifty/trunk/lib/Jifty.pm	(original)
+++ jifty/trunk/lib/Jifty.pm	Mon Nov 10 14:33:02 2008
@@ -376,8 +376,9 @@
 =cut
 
 sub bus {
-
-    unless ($PUB_SUB) {
+    my $class = shift;
+    my %args = ( connect => 1, @_ );
+    if (not $PUB_SUB and $args{connect}) {
         my @args;
 
         my $backend = Jifty->config->framework('PubSub')->{'Backend'};

Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Mon Nov 10 14:33:02 2008
@@ -611,9 +611,11 @@
         Jifty::Test->teardown_mailbox;
 
         # Disconnect the PubSub bus, if need be; otherwise we may not
-        # be able to drop the testing database
+        # be able to drop the testing database.  Calling ->bus, if we
+        # never dealt with PubSub in the test, can actually _do_ the
+        # connect now, unless we explicitly tell it not to.
         Jifty->bus->disconnect
-          if Jifty->config and Jifty->bus;
+          if Jifty->config and Jifty->bus( connect => 0 );
 
         # Remove testing db
         if (Jifty->handle && !$ENV{JIFTY_FAST_TEST}) {


More information about the Jifty-commit mailing list