View | Details | Raw Unified | Return to bug 22417
Collapse All | Expand All

(-)a/Koha/BackgroundJob.pm (-1 / +6 lines)
Lines 48-54 sub enqueue { Link Here
48
            $json_args = encode_json $job_args;
48
            $json_args = encode_json $job_args;
49
49
50
            my $conn = $self->connect;
50
            my $conn = $self->connect;
51
            $conn->send_with_receipt( { destination => $job_type, body => $json_args } )
51
            # This namespace is wrong, it must be a vhost instead.
52
            # But to do so it needs to be created on the server => much more work when a new Koha instance is created.
53
            # Also, here we just want the Koha instance's name, but it's not in the config...
54
            # Picking a random id (memcached_namespace) from the config
55
            my $namespace = C4::Context->config('memcached_namespace');
56
            $conn->send_with_receipt( { destination => sprintf("%s-%s", $namespace, $job_type), body => $json_args } )
52
              or Koha::Exceptions::Exception->throw('Job has not been enqueued');
57
              or Koha::Exceptions::Exception->throw('Job has not been enqueued');
53
        }
58
        }
54
    );
59
    );
(-)a/misc/background_jobs_worker.pl (-2 / +3 lines)
Lines 24-31 my $conn = Koha::BackgroundJob->connect; Link Here
24
24
25
my @job_types = qw( batch_biblio_record_modification batch_authority_record_modification );
25
my @job_types = qw( batch_biblio_record_modification batch_authority_record_modification );
26
26
27
# FIXME cf note in Koha::BackgroundJob about $namespace
28
my $namespace = C4::Context->config('memcached_namespace');
27
for my $job_type ( @job_types ) {
29
for my $job_type ( @job_types ) {
28
    $conn->subscribe({ destination => $job_type, ack => 'client' });
30
    $conn->subscribe({ destination => sprintf("%s-%s", $namespace, $job_type), ack => 'client' });
29
}
31
}
30
while (1) {
32
while (1) {
31
    my $frame = $conn->receive_frame;
33
    my $frame = $conn->receive_frame;
32
- 

Return to bug 22417