2022-11-19 06:03:59 +01:00
|
|
|
class BatchOperationProcessOneJob < ApplicationJob
|
2022-11-18 16:59:46 +01:00
|
|
|
# what about wrapping all of that in a transaction
|
|
|
|
# but, what about nested transaction because batch_operation.process_one(dossier) can run transaction
|
|
|
|
def perform(batch_operation, dossier)
|
|
|
|
success = true
|
|
|
|
begin
|
|
|
|
batch_operation.process_one(dossier)
|
|
|
|
rescue => error
|
|
|
|
success = false
|
|
|
|
raise error
|
|
|
|
ensure
|
2022-11-25 12:30:06 +01:00
|
|
|
batch_operation.track_dossier_processed(success, dossier)
|
2022-11-18 16:59:46 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|