[14.0] [ADD] queue_job_batch_size
This module allows to seemlessly split a big job into smaller jobs.
It uses queue_job_batch to group the created jobs into a batch.
Example:
class ResPartner(models.Model):
# ...
def copy_all_partners(self):
# Duplicate all partners in batches of 30:
self.with_delay(batch_size=30).copy()
# ...
self.env['res.partner'].search([], limit=1000).copy_all_partners()
This will create 34 jobs, each one copying 30 partners (except the last one which will copy 10) and will group them into a batch.
Instead of batch_size, one can also use batch_count to specify the number of batches to create instead.
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.
@paradoxxxzero shall we close this one in favor of https://github.com/OCA/queue/pull/658 ?