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

(-)a/Koha/BackgroundJob.pm (-5 / +8 lines)
Lines 137-147 sub process { Link Here
137
    my ( $self, $args ) = @_;
137
    my ( $self, $args ) = @_;
138
138
139
    my $job_type = $self->type;
139
    my $job_type = $self->type;
140
    return $job_type eq 'batch_biblio_record_modification'
140
    my $class = "Koha::BackgroundJob::${job_type}";
141
      ? Koha::BackgroundJob::BatchUpdateBiblio->process($args)
141
    try{
142
      : $job_type eq 'batch_authority_record_modification'
142
        return $class->process( $args );
143
      ? Koha::BackgroundJob::BatchUpdateAuthority->process($args)
143
    } catch {
144
      : Koha::Exceptions::Exception->throw('->process called without valid job_type');
144
        Koha::Exceptions::Exception->throw('->process called without valid job_type');
145
    };
146
147
145
}
148
}
146
149
147
=head3 job_type
150
=head3 job_type
(-)a/Koha/BackgroundJob/BatchUpdateAuthority.pm (-1 / +1 lines)
Lines 43-49 Define the job type of this job: batch_authority_record_modification Link Here
43
=cut
43
=cut
44
44
45
sub job_type {
45
sub job_type {
46
    return 'batch_authority_record_modification';
46
    return 'BatchUpdateAuthority';
47
}
47
}
48
48
49
=head3 process
49
=head3 process
(-)a/Koha/BackgroundJob/BatchUpdateBiblio.pm (-1 / +1 lines)
Lines 42-48 Define the job type of this job: batch_biblio_record_modification Link Here
42
=cut
42
=cut
43
43
44
sub job_type {
44
sub job_type {
45
    return 'batch_biblio_record_modification';
45
    return 'BatchUpdateBiblio';
46
}
46
}
47
47
48
=head3 process
48
=head3 process
(-)a/misc/background_jobs_worker.pl (-2 / +2 lines)
Lines 28-34 try { Link Here
28
    warn sprintf "Cannot connect to the message broker, the jobs will be processed anyway (%s)", $_;
28
    warn sprintf "Cannot connect to the message broker, the jobs will be processed anyway (%s)", $_;
29
};
29
};
30
30
31
my @job_types = qw( batch_biblio_record_modification batch_authority_record_modification );
31
# FIXME Job types should be stored in a table so that plugins can register new job types as well
32
my @job_types = qw( BatchUpdateBiblio BatchUpdateAuthority );
32
33
33
if ( $conn ) {
34
if ( $conn ) {
34
    # FIXME cf note in Koha::BackgroundJob about $namespace
35
    # FIXME cf note in Koha::BackgroundJob about $namespace
35
- 

Return to bug 27434