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

(-)a/Koha/BackgroundJob.pm (-1 / +6 lines)
Lines 50-56 sub enqueue { Link Here
50
            $json_args = encode_json $job_args;
50
            $json_args = encode_json $job_args;
51
51
52
            my $conn = $self->connect;
52
            my $conn = $self->connect;
53
            $conn->send_with_receipt( { destination => $job_type, body => $json_args } )
53
            # This namespace is wrong, it must be a vhost instead.
54
            # But to do so it needs to be created on the server => much more work when a new Koha instance is created.
55
            # Also, here we just want the Koha instance's name, but it's not in the config...
56
            # Picking a random id (memcached_namespace) from the config
57
            my $namespace = C4::Context->config('memcached_namespace');
58
            $conn->send_with_receipt( { destination => sprintf("%s-%s", $namespace, $job_type), body => $json_args } )
54
              or Koha::Exceptions::Exception->throw('Job has not been enqueued');
59
              or Koha::Exceptions::Exception->throw('Job has not been enqueued');
55
        }
60
        }
56
    );
61
    );
(-)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