8000 refactor(payouts): support recursive commission processing with cursor-based pagination by BharathxD · Pull Request #2336 · dubinc/dub · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor(payouts): support recursive commission processing with cursor-based pagination #2336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BharathxD
Copy link
Contributor

Previously, the payouts cron endpoint processed a fixed batch of commissions and relied on a manual TODO to improve recursive handling (similar to the usage cron). This PR refactors the logic to:

  • Extract the core commission-processing workflow into apps/web/app/api/cron/payouts/utils.ts
  • Introduce a lexicographic cursor (programId + partnerId) to page through large commission volumes
  • Schedule follow-up batches via QStash if the batch size hits the defined limit
  • Simplify the route handler to focus on request verification and delegate business logic
  • Preserve existing behavior, only adding recursive scheduling and better error logging

This change enhances scalability for high-commission workloads and aligns the payouts job with the pattern used in the usage cron.

Copy link
vercel bot commented Apr 22, 2025

@BharathxD is attempting to deploy a commit to the Dub Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0