谢谢 clippy
This commit is contained in:
parent
c0ea480832
commit
0cd3a6c4ae
@ -114,8 +114,10 @@ async fn serve_mode(mut stop_receiver: Receiver<()>) -> anyhow::Result<()> {
|
||||
event!(Level::INFO, "{}", "结束下载!".yellow());
|
||||
// 结束 db
|
||||
db_connect.close().await?;
|
||||
if conf.serve.enable && web_waiter.is_some() {
|
||||
web_waiter.unwrap().abort();
|
||||
if conf.serve.enable {
|
||||
if let Some(web_waiter) = web_waiter {
|
||||
web_waiter.abort();
|
||||
}
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use axum::{extract::State, routing::get, Json, Router};
|
||||
use sea_orm::{ActiveEnum, DatabaseConnection};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{config::ConfigFile, db_part};
|
||||
use crate::db_part;
|
||||
use migration::SaveId;
|
||||
|
||||
/// 最后一个数据的信息
|
||||
@ -79,7 +79,7 @@ async fn get_last_ship(State(db): State<DatabaseConnection>) -> Json<Option<Last
|
||||
|
||||
pub async fn web_main() -> anyhow::Result<()> {
|
||||
let conf = crate::config::ConfigFile::try_read()?;
|
||||
|
||||
|
||||
let listener = tokio::net::TcpListener::bind(conf.serve.host_with_port.clone()).await?;
|
||||
let db = db_part::connect_server(&conf).await?;
|
||||
let app = Router::new()
|
||||
|
Loading…
Reference in New Issue
Block a user