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

(-)a/misc/workers/background_jobs_worker.pl (-1 / +6 lines)
Lines 129-135 while (1) { Link Here
129
129
130
        # FIXME This means we need to have create the DB entry before
130
        # FIXME This means we need to have create the DB entry before
131
        # It could work in a first step, but then we will want to handle job that will be created from the message received
131
        # It could work in a first step, but then we will want to handle job that will be created from the message received
132
        my $job = Koha::BackgroundJobs->search( { id => $args->{job_id}, status => 'new' } )->next;
132
        my ( $job, $i );
133
        while ( !$job ) {
134
            $job = Koha::BackgroundJobs->search( { id => $args->{job_id}, status => 'new' } )->next;
135
            sleep 1 unless $job;
136
            last if ++$i >= 10;
137
        }
133
138
134
        unless( $job ) {
139
        unless( $job ) {
135
            Koha::Logger->get( { interface => 'worker' } )
140
            Koha::Logger->get( { interface => 'worker' } )
(-)a/misc/workers/es_indexer_daemon.pl (-2 / +6 lines)
Lines 126-132 while (1) { Link Here
126
126
127
        # FIXME This means we need to have create the DB entry before
127
        # FIXME This means we need to have create the DB entry before
128
        # It could work in a first step, but then we will want to handle job that will be created from the message received
128
        # It could work in a first step, but then we will want to handle job that will be created from the message received
129
        my $job = Koha::BackgroundJobs->search( { id => $args->{job_id}, status => 'new' } )->next;
129
        my ( $job, $i );
130
        while ( !$job ) {
131
            $job = Koha::BackgroundJobs->search( { id => $args->{job_id}, status => 'new' } )->next;
132
            sleep 1 unless $job;
133
            last if ++$i >= 10;
134
        }
130
135
131
        unless ($job) {
136
        unless ($job) {
132
            $logger->warn( sprintf "Job %s not found, or has wrong status", $args->{job_id} );
137
            $logger->warn( sprintf "Job %s not found, or has wrong status", $args->{job_id} );
133
- 

Return to bug 35819