添加注释

This commit is contained in:
李运家 2024-06-27 15:35:33 +08:00
parent 80caca2dc8
commit b8cb188bb6
4 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@ use library::config;
mod controller;
mod router;
/// 启动服务
pub async fn serve() {
let addr = format!("0.0.0.0:{}", config!().server.port);

View File

@ -3,6 +3,7 @@ use tokio_cron_scheduler::{JobScheduler, JobSchedulerError};
pub(crate) mod task;
/// 启动定时任务
pub async fn start() {
match schedule().await {
Ok(_) => tracing::info!("定时任务启动成功"),

View File

@ -5,6 +5,7 @@ use sqlx_postgres::{PgPool, PgPoolOptions};
static DB: OnceLock<PgPool> = OnceLock::new();
/// 初始化数据库连接池
pub async fn init_database(config: &Config) {
let db_cfg = &config.database;

View File

@ -18,6 +18,7 @@ impl FormatTime for LocalTimer {
}
}
/// 初始化日志
pub fn init_log(config: &Config) -> (WorkerGuard, WorkerGuard) {
let logger_cfg = config.logger.clone();
let (stdout_tracing_appender, std_guard) = tracing_appender::non_blocking(std::io::stdout());