Bug 17600: Standardize our EXPORT_OK
[srvgit] / Koha / BackgroundJob.pm
index 1a25c32..c303fa1 100644 (file)
@@ -16,10 +16,10 @@ package Koha::BackgroundJob;
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
-use JSON qw( encode_json decode_json );
+use JSON qw( decode_json encode_json );
 use Carp qw( croak );
 use Net::Stomp;
-use Try::Tiny;
+use Try::Tiny qw( catch try );
 
 use C4::Context;
 use Koha::DateUtils qw( dt_from_string );
@@ -77,13 +77,7 @@ sub connect {
         $credentials->{host} = $config->{vhost} if $config->{vhost};
     }
     my $stomp = Net::Stomp->new( { hostname => $hostname, port => $port } );
-    my $frame = $stomp->connect( $credentials );
-    unless ($frame && $frame->command eq 'CONNECTED'){
-        if ($frame){
-            warn $frame->as_string;
-        }
-        die "Cannot connect to message broker";
-    }
+    $stomp->connect( $credentials );
     return $stomp;
 }