Retry pulling provider taxes for stuck pending invoices - #5987
Retry pulling provider taxes for stuck pending invoices#5987lago-claude-ai-agent[bot] wants to merge 3 commits into
Conversation
## Context Invoices occasionally stay in a pending status with taxes still pending even though the provider-tax pull job reports success, and the root cause has not been identified from the logs. ## Description Add a daily clock job that re-enqueues the provider-tax pull for every invoice stuck in pending status with a pending tax status, so they get a recurring chance to complete instead of staying pending indefinitely. Signed-off-by: lago-claude-ai-agent[bot] <297187938+lago-claude-ai-agent[bot]@users.noreply.github.com>
|
PASS — Adds a daily clock job that re-enqueues the provider-tax pull for pending invoices whose taxes are still pending; verified against the codebase and CI is green.
Non-blocking: the job scans all organizations' invoices via |
|
The job re-enqueues every What about adding a restriction, for instance something like |
|
|
||
| def perform | ||
| Invoice | ||
| .pending |
There was a problem hiding this comment.
subscription_gated invoices should be included as well?
Skip invoices untouched for over 7 days so unrecoverable ones stop retrying. Signed-off-by: lago-claude-ai-agent[bot] <297187938+lago-claude-ai-agent[bot]@users.noreply.github.com>
|
Thanks for the review — here's how I addressed each point.
|
|
Held: CI is not green on this PR; not reviewed. Re-run CI, then re-review. Checks: https://github.com/getlago/lago-api/pull/5987/checks |
2 similar comments
|
Held: CI is not green on this PR; not reviewed. Re-run CI, then re-review. Checks: https://github.com/getlago/lago-api/pull/5987/checks |
|
Held: CI is not green on this PR; not reviewed. Re-run CI, then re-review. Checks: https://github.com/getlago/lago-api/pull/5987/checks |
|
PASS — Nightly clock job re-enqueues the provider-tax pull for invoices stuck in
Non-blocking:
|
Adds a daily clock job (
Clock::RetryTaxPendingInvoicesJob) that re-enqueuesInvoices::ProviderTaxes::PullTaxesAndApplyJobfor every invoice stuck inpendingstatus withtax_pending, so invoices whose tax pull never completed recover automatically instead of staying pending.Root-cause investigation of why the pull leaves invoices pending is out of scope here; this is the nightly-retry fallback.