mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 18:36:21 +00:00
feat(cron) call the module
This commit is contained in:
5 files changed
+51
-22
No files matched your search
@@ -1,3 +1,4 @@
|
||||
mod cron;
|
||||
mod database;
|
||||
pub mod logger;
|
||||
pub mod server;
|
||||
@@ -22,6 +23,7 @@ pub fn load_env() {
|
||||
}
|
||||
|
||||
pub async fn start() {
|
||||
// connect database
|
||||
let db_pool = match database::init().await {
|
||||
Ok(pool) => {
|
||||
info!("database connection pool initialized");
|
||||
@@ -36,6 +38,12 @@ pub async fn start() {
|
||||
}
|
||||
};
|
||||
|
||||
// schema init
|
||||
|
||||
// load cron task
|
||||
cron::start();
|
||||
|
||||
// api serve
|
||||
match server::start(db_pool).await {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
|
||||
Reference in new issue
Block a user