Bugzilla – Attachment 145598 Details for
Bug 32393
background job worker explodes if JSON is incorrect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32393: Deal with the DB fallback part
Bug-32393-Deal-with-the-DB-fallback-part.patch (text/plain), 1.15 KB, created by
Jonathan Druart
on 2023-01-24 08:23:06 UTC
(
hide
)
Description:
Bug 32393: Deal with the DB fallback part
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-01-24 08:23:06 UTC
Size:
1.15 KB
patch
obsolete
>From 1dfb3f4a3ad6e4281639d3fcd9e0c9f2180ecb38 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 24 Jan 2023 09:11:25 +0100 >Subject: [PATCH] Bug 32393: Deal with the DB fallback part > >--- > misc/background_jobs_worker.pl | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl >index 059d7069ba8..44f7990ed46 100755 >--- a/misc/background_jobs_worker.pl >+++ b/misc/background_jobs_worker.pl >@@ -119,8 +119,17 @@ while (1) { > } else { > my $jobs = Koha::BackgroundJobs->search({ status => 'new', queue => \@queues }); > while ( my $job = $jobs->next ) { >- my $args = $job->json->decode($job->data); >+ my $args = try { >+ $job->json->decode($job->data); >+ } catch { >+ Koha::Logger->get->warn(sprintf "Cannot decode data for job id=%s", $job->id); >+ $job->status('failed')->store; >+ }; >+ >+ next unless $args; >+ > process_job( $job, { job_id => $job->id, %$args } ); >+ > } > sleep 10; > } >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32393
:
144401
|
144569
|
145064
|
145207
|
145216
|
145217
|
145596
|
145597
|
145598
|
145609
|
145610
|
145611
|
145613
|
145614
|
145615
|
145616