mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
13 lines
347 B
Rust
13 lines
347 B
Rust
use crate::blog;
|
|
use crate::scheduler::Scheduler;
|
|
use sqlx::{Pool, Postgres};
|
|
|
|
pub fn start(db_pool: Pool<Postgres>) {
|
|
let scheduler = Scheduler::new();
|
|
let _ = vec![blog::cron::get_tasks(db_pool.clone())]
|
|
.into_iter()
|
|
.map(|list| scheduler.insert_list(list))
|
|
.collect::<Vec<_>>();
|
|
scheduler.start().unwrap()
|
|
}
|