Conversation
Codecov Report
@@ Coverage Diff @@
## main #730 +/- ##
==========================================
+ Coverage 38.95% 39.11% +0.16%
==========================================
Files 73 73
Lines 9729 9643 -86
Branches 2227 2183 -44
==========================================
- Hits 3790 3772 -18
+ Misses 4885 4819 -66
+ Partials 1054 1052 -2 |
b56ad50 to
2ba0cf2
Compare
igalic
commented
Feb 18, 2020
| } | ||
| fn respond_to(self, r: &'r Request<'_>) -> response::ResultFuture<'r> { | ||
| Box::pin(async move { | ||
| let contents = std::fs::read(self.0.path()).map_err(|_| Status::InternalServerError)?; |
Contributor
Author
There was a problem hiding this comment.
this std::fs::read could (should?) be async.
Member
There was a problem hiding this comment.
It could with something like async-std, yes. But maybe add a todo and leave it for a future PR?
and run cargo update
it only took 3 hours of @jebrosen's patient help.
n.b.: I do *not* like the error handling in api_tokens 😒️
there doesn't seem to be a request.guard_async (yet?)
where sensible! note that State has no asynchronous work to do, so wrapping it up in async makes no sense.
i'm using this opportunity to also update reqwest (0.10), but it's turning out to be a little trickier, as it requires more modern async setup, and that appears to need a lot of thinking…
defer, or, trait functions such as it in general(?) cannot be async (yet)
including the use of tokio!
this allows us to actually move stuff into the async block and we can drop the 'static life-time.
this way, we only spawn one, and reuse that.
template utils and error routes
as requested in Plume-org/webfinger#8 and provided in Plume-org/webfinger#9 ``` meena@76ix ~/s/a/plume (go/async) [101]> cargo update --package webfinger Updating crates.io index Updating git repository `https://github.com/Plume-org/webfinger` Removing bytes v0.4.12 Removing cookie v0.12.0 Removing cookie_store v0.7.0 Removing crossbeam-deque v0.7.2 Removing crossbeam-epoch v0.8.0 Removing crossbeam-queue v0.1.2 Removing crossbeam-utils v0.7.0 Removing h2 v0.1.26 Removing http v0.1.21 Removing http-body v0.1.0 Removing hyper v0.12.35 Removing hyper-tls v0.3.2 Removing publicsuffix v1.5.4 Removing reqwest v0.9.24 Removing serde_urlencoded v0.5.5 Removing string v0.2.1 Removing tokio v0.1.22 Removing tokio-buf v0.1.1 Removing tokio-current-thread v0.1.6 Removing tokio-executor v0.1.9 Removing tokio-io v0.1.12 Removing tokio-reactor v0.1.11 Removing tokio-sync v0.1.7 Removing tokio-tcp v0.1.3 Removing tokio-threadpool v0.1.17 Removing tokio-timer v0.2.12 Removing try_from v0.3.2 Removing want v0.2.0 Adding webfinger v0.5.0 (https://github.com/Plume-org/webfinger?rev=update-deps#cdaab95e) Removing webfinger v0.5.0 meena@76ix ~/s/a/plume (go/async)> ```
this also upgrades some dependencies some of that fixes stuff, others breaks stuff.
i forgot that we can't `Send` diesel connections over threads, so this is going to require some rethinking.
that our Connection is not Send-safe. once we get there, we can start thinking about restructing the way we pass along our connection, or consider using #[database].
…on is not Send-safe.
that our Connection is not Send-safe.
so we can .await without worries. plus, it changes nothing about the code, other than making the intent clearer at first sight.
not happy about this lint or rust behaviour where the return statement must not have a `;`
we do this by making the macro parse and generate doc comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
update rocket and its dependencies to their
asyncbranch.update our code to use rocket's async APIs