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 |
- |
|
|