Skip to content
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

Retrieve wallet states concurrently in redemption service #828

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

evandrosaturnino
Copy link

Description

This PR updates the findWalletForRedemption function to retrieve all wallet states concurrently by using Promise.all rather than reading them one by one. This change reduces the redemption processing time from several minutes (6–7 minutes) down to approximately 15-20 seconds.

Key Changes

  • Retrieve wallet states concurrently using Promise.all.
  • After retrieval, iterate over the assembled data to select the appropriate wallet.
  • Preserve the existing logic for determining suitability based on live status, pending redemptions, and sufficient balance.

Impact

Type of change

  • 💅 Refactoring (Non-breaking Change)
  • 🐛 Bug fix (Non-breaking Change: Fixes an issue)
  • 🛠️ Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..

Notice

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

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