Why Rails' ActiveJob enqueuing was designed to be so lax?

Let's assume we have a job MyJob with perform(param1:, param:2) now, when instantiating or enqueuing it: job = MyJob.new(param1:) ActiveJob.perform_all_later([job]) # or MyJob.perform_later(param1:) the enqueuing happens without issue, but the task fails because of the missing keyword param:2 during execution. Does anyone know why was it designed like this? (I assume it's not accidental because I can't be the first one bitten by that. If it was accidental, I think it would have been fixed by now) My understanding so far is this: Let's assume we have a web request (user submits a form) and this request is supposed to perform a heavy operation in the background. The request will succeed, but the job will fail. So now, the dev can see what's wrong and "update" the enqueued job, and trigger it to run again? But that's only if the missing data can be found. I can imagine there would be some cases where app developers would prefer to "fail early".

Jan 22, 2025 - 09:17
 0
Why Rails' ActiveJob enqueuing was designed to be so lax?

Let's assume we have a job MyJob with

perform(param1:, param:2)

now, when instantiating or enqueuing it:

job = MyJob.new(param1:)
ActiveJob.perform_all_later([job])
# or
MyJob.perform_later(param1:)

the enqueuing happens without issue, but the task fails because of the missing keyword param:2 during execution.

Does anyone know why was it designed like this? (I assume it's not accidental because I can't be the first one bitten by that. If it was accidental, I think it would have been fixed by now)

My understanding so far is this:

Let's assume we have a web request (user submits a form) and this request is supposed to perform a heavy operation in the background. The request will succeed, but the job will fail. So now, the dev can see what's wrong and "update" the enqueued job, and trigger it to run again? But that's only if the missing data can be found. I can imagine there would be some cases where app developers would prefer to "fail early".

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow