You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to use bulk enqueueing of jobs in a project. It worked with both approaches (block form or instantiating jobs and then using GoodJob::Bulk.enqueue(jobs)), however, when looking at the SQL logs, I saw one insert statement for each job instead of just one in total.
Digging deeper, I found the relevant code which prevents that:
So jobs are partitioned into bulkable and unbulkable jobs - and jobs are unbulkable if they have concurrency control configured. I understand why this could be a problem with batch-insertion of jobs, but still wanted to check whether implementing this could be possible. Otherwise, it might at least be good to mention that limitation in the readme (I'll gladly contribute that!).
At least for me, this unfortunately makes bulk unusable, as I alway configure concurrency for all jobs as a best practice 🤪 But aside of that, I totally love this gem ❤️
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to use bulk enqueueing of jobs in a project. It worked with both approaches (block form or instantiating jobs and then using
GoodJob::Bulk.enqueue(jobs)), however, when looking at the SQL logs, I saw one insert statement for each job instead of just one in total.Digging deeper, I found the relevant code which prevents that:
good_job/lib/good_job/bulk.rb
Lines 95 to 98 in 0ffbbac
So jobs are partitioned into bulkable and unbulkable jobs - and jobs are unbulkable if they have concurrency control configured. I understand why this could be a problem with batch-insertion of jobs, but still wanted to check whether implementing this could be possible. Otherwise, it might at least be good to mention that limitation in the readme (I'll gladly contribute that!).
At least for me, this unfortunately makes bulk unusable, as I alway configure concurrency for all jobs as a best practice 🤪 But aside of that, I totally love this gem ❤️
Beta Was this translation helpful? Give feedback.
All reactions