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

Upgrade to actix 1.0 #6677

Merged
merged 2 commits into from Jun 22, 2019

Conversation

@davidMcneil
Copy link
Contributor

commented Jun 21, 2019

Resolves #6620

Signed-off-by: David McNeil mcneil.david2@gmail.com

@davidMcneil davidMcneil self-assigned this Jun 21, 2019

@davidMcneil davidMcneil force-pushed the dmcneil/upgrade-actix-web branch from 0c81cbf to 2727b95 Jun 21, 2019

Upgrade to actix 1.0
Signed-off-by: David McNeil <mcneil.david2@gmail.com>

@davidMcneil davidMcneil force-pushed the dmcneil/upgrade-actix-web branch from 2727b95 to 04a4eb5 Jun 21, 2019

sys.run();
if let Ok(b) = bind {
b.run().expect("to start http server");
}

This comment has been minimized.

Copy link
@raskchanky

raskchanky Jun 21, 2019

Member

Why move this block outside the lock match on line 266? Why not just change b.start(); to b.run().expect("to start http server");?

This comment has been minimized.

Copy link
@raskchanky

raskchanky Jun 21, 2019

Member

Ah, unless b.run() is the point of no return, like sys.run() was before?

This comment has been minimized.

Copy link
@davidMcneil

davidMcneil Jun 21, 2019

Author Contributor

Correct. That being said I am not a hug fan of matching twice on bind so if you have a better way to formulate it that would be awesome.

This comment has been minimized.

Copy link
@baumanj

baumanj Jun 21, 2019

Member

I don't see a good way around it either.

@baumanj
Copy link
Member

left a comment

Looks great! A few minor suggestions, but they're all optional

}

struct Metrics;
};

This comment has been minimized.

Copy link
@baumanj

baumanj Jun 21, 2019

Member

I have a slight preference for if lets in this kind of case, since they are shorter and less indented:

    let current_token = if let Some(t) = current_token {
        t
    } else {
        debug!("No authentication token present. HTTP gateway starting in unauthenticated mode.");
        return Either::A(srv.call(req));
    };
.replace(None);
if timer.is_some() {
timer.unwrap().observe_duration();
}

This comment has been minimized.

Copy link
@baumanj

baumanj Jun 21, 2019

Member

I realize this is how the code was already, but it seems simpler/idiomatic (and avoids an unwrap) to:

                     if let Some(timer) = res.request()
                                             .app_data::<AppState>()
                                             .expect("app data")
                                             .timer
                                             .replace(None)
                     {
                         timer.observe_duration();
                     }
sys.run();
if let Ok(b) = bind {
b.run().expect("to start http server");
}

This comment has been minimized.

Copy link
@baumanj

baumanj Jun 21, 2019

Member

I don't see a good way around it either.

@raskchanky
Copy link
Member

left a comment

Thanks for doing this work!

PR feedback
Signed-off-by: David McNeil <mcneil.david2@gmail.com>

@davidMcneil davidMcneil merged commit aa399c6 into master Jun 22, 2019

5 checks passed

DCO This commit has a DCO Signed-off-by
Details
buildkite/habitat-sh-habitat-master-verify Build #2474 passed (24 minutes, 9 seconds)
Details
buildkite/habitat-sh-habitat-master-website Build #2938 passed (51 seconds)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
expeditor/config-validation Validated your Expeditor config file
Details

chef-ci added a commit that referenced this pull request Jun 22, 2019

Update CHANGELOG.md with details from pull request #6677
Obvious fix; these changes are the result of automation not creative thinking.

@davidMcneil davidMcneil deleted the dmcneil/upgrade-actix-web branch Jul 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.