Lines 151-158
sub enqueue {
Link Here
|
151 |
my $namespace = C4::Context->config('memcached_namespace'); |
151 |
my $namespace = C4::Context->config('memcached_namespace'); |
152 |
my $encoded_args = Encode::encode_utf8($json_args); # FIXME We should better leave this to Net::Stomp? |
152 |
my $encoded_args = Encode::encode_utf8($json_args); # FIXME We should better leave this to Net::Stomp? |
153 |
my $destination = sprintf( "/queue/%s-%s", $namespace, $job_queue ); |
153 |
my $destination = sprintf( "/queue/%s-%s", $namespace, $job_queue ); |
154 |
$conn->send_with_receipt( { destination => $destination, body => $encoded_args, persistent => 'true' } ) |
154 |
$conn->send_with_receipt( |
155 |
or Koha::Exceptions::BackgroundJob->throw('Job has not been enqueued'); |
155 |
{ |
|
|
156 |
destination => $destination, body => $encoded_args, persistent => 'true', |
157 |
'content-type' => 'application/json' |
158 |
} |
159 |
) or Koha::Exceptions::BackgroundJob->throw('Job has not been enqueued'); |
156 |
} catch { |
160 |
} catch { |
157 |
$self->status('failed')->store; |
161 |
$self->status('failed')->store; |
158 |
if ( ref($_) eq 'Koha::Exceptions::BackgroundJob' ) { |
162 |
if ( ref($_) eq 'Koha::Exceptions::BackgroundJob' ) { |