Bug 29388

Summary: No need to decode data from misc/background_jobs_worker.pl
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 22417    
Bug Blocks:    
Attachments: Bug 29388: don't decode data from misc/background_jobs_worker.pl

Description Jonathan Druart 2021-11-02 11:26:55 UTC
From misc/background_jobs_worker.pl we are decoding the data, and pass it as an argument to ->process, this is a bit weird as we are fetching the job from ->process we could retrieve the data from there.
Comment 1 Jonathan Druart 2021-11-02 11:27:42 UTC
Created attachment 127211 [details] [review]
Bug 29388: don't decode data from misc/background_jobs_worker.pl
Comment 2 Jonathan Druart 2021-11-02 11:29:59 UTC
Logging that here as I won't do the same mistake again.
This is actually invalid, see the FIXME:

 59         # FIXME This means we need to have create the DB entry before
 60         # It could work in a first step, but then we will want to handle job that will be created from the message received
 61         my $job = Koha::BackgroundJobs->find($args->{job_id});

We actually need a way to enqueue without creating the row in DB, sending the request to RabbitMQ would be enough.

Isn't it?