I am building a scheduled job which will get records of a child table called “Vouchers“ and it will audit this voucher using background jobs ie., frappe.enqueue.
this is the logic, i am using
- Finds vouchers which needs to be audited, splits into batches of 25, enqueues background jobs via frappe.enqueue()
- Background Workers (parallel): Process batches in “long” queue
So how can i log the summary of the entire process(). ie, i want to log the stats like
Total Vouchers Picked: 100,
Successful Audited Vouchers: 90,
Vouchers which got error while auditing: 10
Duration: 30 mins - 10:00:00 - 10:30:00.
So has i am using background jobs for batch processing, how can i consolidate the results from all background jobs?