-
Notifications
You must be signed in to change notification settings - Fork 94
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
ref(server): Use async/await in all endpoints #1862
Conversation
The failing integration test shows that error reporting has changed with my refactored store endpoints. Since the endpoints now return an error, See the following excerpt. The first line is our manual log, the other two are now added by actix_web:
I'm looking into a quick fix. It's useful to return an error, but on the other hand we want clean error logs and reports. Update: Like in the past, the only workaround is to convert |
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.
lgtm 🚀
Co-authored-by: Oleksandr <1931331+olksdr@users.noreply.github.com>
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.
Did not look at the details but in general this looks good to me! Great improvement in code readability.
|
||
/// Consume the remaining response body. | ||
pub async fn consume(mut self) { | ||
while let Ok(Some(_)) = self.chunk().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.
If self.chunk()
returns an error, this function will silently fail. Is that the same behavior as we had before?
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.
Yes, we want to consume until there's an error and then bail.
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.
So much simpler! 🙌
* master: feat(metrics): Tag the sample decision on count_per_root_project (#1870) feat(protocol): Add sourcemap debug image type to protocol (#1869) ref(statsd): Revert back the adition of metric names as tag on Sentry errors (#1873) feat(profiling): Add PHP support (#1871) fix(panic): revert sentry-types to 0.20.1 (#1872) ref(server): Use async/await in all endpoints (#1862) ref: Buffer envelopes for broken project states (#1856) meta: Remove accidentally added GeoIP file (#1866)
Moves all endpoints and most HTTP utilities to async/await. This is to prepare
upgrading the web framework.
#skip-changelog