[Koha-bugs] [Bug 22417] Delegate background jobs execution

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 9 14:59:36 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22417

--- Comment #41 from David Cook <dcook at prosentient.com.au> ---
git diff ff4c85109f043c4086c9348e5e88638cc5a7ebd5~1..HEAD

TODOs: 
1. Agree raising exceptions is better than returning null 
2. A new "manage_background_jobs" permission might make sense for managing
supervisor permissions, but I figure whoever enqueued the job should be able to
check on its progress, so this might not make sense. 

We should manage background job permissions based on their other permissions,
although that gets tricky. I suppose we could pass the background job type,
validate it against a list (and translate it to an existing permission), and
then put it into flagsrequired. If there is no background job type passed, then
we assume it's all, and then we could use "manage_background_jobs" as the
permission which would allow a supervisor/superlibrarian to view all jobs at
once?

Alternatively, admin/background_jobs.tt is for supervisors/superlibrarians
only, and each tool implements its own interface for tracking tasks. That might
be necessary in any case, as the existing functionality isn't very librarian
friendly. While "Background Jobs" make sense to developers, I don't think
librarians will necessarily understand the concept, nor should they need to. 

FIXMEs:
Too many to comment on right now, plus would be easier to comment on if you
uploaded a patchset to Bugzilla. 

I think we might have too much specific/tightly-coupled logic in
Koha/BackgroundJob.pm. 

I notice too there is some "enqueue" copy/paste code between
Koha/BackgroundJob/BatchUpdateBiblio.pm and
Koha/BackgroundJob/BatchUpdateAuthority.pm, which could be put into a
base/parent class.

I think it would make sense to put the "process" code into something like
"Koha/Worker/BatchUpdateBiblio.pm", and to use a "Koha/Worker/Base.pm" type
class to handle the messaging aspect for the workers. 

I could provide more feedback but it is late and I need to get up early.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list