Page MenuHomePhabricator

Can the recurring charge job pick up payments one by one?
Open, Needs TriagePublic4 Estimated Story Points

Description

We're currently having it pick up the whole batch at the beginning of the run, in the theory that it will lead to fewer deadlocks than individual queries for each payment.

But that gives us problems when Donor Relations edits the record. We have added a check for status change to pick up donations cancelled since the batch began. Now that donor relations is going to start editing dates of records, we could either add more checks (on e.g. the last modified date) or we could just go to pulling the full parameters at the moment of charging.

Try adding a 'limit 1' to the sql generated by the API call in SmashPigRecurringProcessor::getPaymentsToCharge and see if it's locking many tables.