review fixes

This commit is contained in:
Marin Postma 2021-04-22 12:39:23 +02:00
parent e4bd1bc5ce
commit c2461e5066
No known key found for this signature in database
GPG key ID: D5241F0C0C865F30
9 changed files with 102 additions and 425 deletions

View file

@ -72,20 +72,14 @@ async fn main() -> Result<(), MainError> {
print_launch_resume(&opt, &data);
let enable_frontend = opt.env != "production";
run_http(data, opt, enable_frontend).await?;
run_http(data, opt).await?;
Ok(())
}
#[allow(unused_variables)]
async fn run_http(
data: Data,
opt: Opt,
enable_frontend: bool,
) -> Result<(), Box<dyn std::error::Error>> {
let http_server = HttpServer::new(move || create_app!(&data, enable_frontend))
async fn run_http(data: Data, opt: Opt) -> Result<(), Box<dyn std::error::Error>> {
let _enable_dashboard = &opt.env == "development";
let http_server = HttpServer::new(move || create_app!(&data, _enable_dashboard))
// Disable signals allows the server to terminate immediately when a user enter CTRL-C
.disable_signals();
@ -103,11 +97,11 @@ async fn run_http(
pub fn print_launch_resume(opt: &Opt, data: &Data) {
let commit_sha = match option_env!("COMMIT_SHA") {
Some("") | None => env!("VERGEN_SHA"),
Some(commit_sha) => commit_sha
Some(commit_sha) => commit_sha,
};
let commit_date = match option_env!("COMMIT_DATE") {
Some("") | None => env!("VERGEN_COMMIT_DATE"),
Some(commit_date) => commit_date
Some(commit_date) => commit_date,
};
let ascii_name = r#"