修改main函数
This commit is contained in:
parent
fd989ca5d4
commit
c67884677c
@ -9,6 +9,11 @@ mod tasks;
|
||||
|
||||
/// 启动服务
|
||||
pub async fn serve() {
|
||||
// 初始化日志、数据库连接池、内存缓存;初始化顺序不可变更
|
||||
let (_std_guard, _file_guard) = library::core::logger::init_log();
|
||||
library::core::db::init_database().await;
|
||||
library::cache::inner_cache::init_cache().await;
|
||||
|
||||
let addr = format!("0.0.0.0:{}", config!().server.port);
|
||||
let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
|
||||
tracing::info!("服务监听地址: {}", addr);
|
||||
|
@ -5,10 +5,5 @@ static GLOBAL: MiMalloc = MiMalloc;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// 初始化日志、数据库连接池、内存缓存;初始化顺序不可变更
|
||||
let (_std_guard, _file_guard) = library::core::logger::init_log();
|
||||
library::core::db::init_database().await;
|
||||
library::cache::inner_cache::init_cache().await;
|
||||
|
||||
server::serve().await;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user