[Koha-bugs] [Bug 30943] Make background job classes use helpers

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 27 11:42:14 CET 2023


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

--- Comment #12 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Marcel de Rooy from comment #11)
> Please read the history on both bugs.

On bug 32305, they discuss the Koha::BackgroundJob->process method, making it
not initiate a background job unless its status is 'new()', with different
approaches and in discussion, as you noticed.

This bug is only taking care of making already existing helpers be used to
reduce the amount of unnecessary code, like this:

-    my $job_progress = 0;
-    $self->started_on(dt_from_string)->progress($job_progress)
-      ->status('started')->store;
+    $self->start;

the place in which they might have an intersection, is that ->start will raise
an exception if the status is not new().

We don't have a 'retry' mechanism on failure and we don't have a proper way to
deal with stale/wrong messages in rabbit. But I'm pretty sure we'd prefer to
explode earlier if a job is asked to be started when it shouldn't.

I'd say, as per comment 4, that we could rename start() => mark_started(). But
that's out of the scope of this bug.

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


More information about the Koha-bugs mailing list