-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Indexer-Grpc-V2] Add HistoricalDataService. #15788
Conversation
⏱️ 53m total CI duration on this PR
🚨 2 jobs on the last run were significantly faster/slower than expected
|
1f2c07b
to
3af42e9
Compare
ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/historical_data_service.rs
Outdated
Show resolved
Hide resolved
bceab25
to
0cba850
Compare
0cba850
to
8a3cf6f
Compare
8a3cf6f
to
0578c27
Compare
let request = req.into_inner(); | ||
let mut stream = live_data_service | ||
.get_transactions(Request::new(request)) | ||
.await? | ||
.into_inner(); | ||
let peekable = std::pin::pin!(stream.as_mut().peekable()); | ||
if let Some(Ok(_)) = peekable.peek().await { | ||
return live_data_service | ||
.get_transactions(Request::new(request)) | ||
.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.
The request is consumed by into_inner()
but then used again to create a new request, which will fail at runtime. To fix this, clone the request before the first consumption:
let request = req.clone().into_inner();
This ensures the request data is available for both operations.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Description
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist