-
Notifications
You must be signed in to change notification settings - Fork 156
Parallelize reward account fetches #3815
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
Conversation
| // Wrap the task, making it wait for a semaphore permit first | ||
| let task = async move { | ||
| // Acquire the permit | ||
| let permit = semaphore.acquire().await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is safe to just call unwrap() on this since this returns a result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unwrap() where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one returns the resultlet permit = semaphore.acquire().await;
so if the semaphore is dropped it can return an error, which should not happen, so we can just unwrap here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yep 👍
No description provided.