feat(init::schema) init database schema

This commit is contained in:
lumither committed 2024-11-20 21:38:36 -08:00
1 parent 7f400470ff
commit 99a19d8d9e
6 files changed
+71 -13

No files matched your search

+3 -2
View File
@@ -1,9 +1,10 @@
use crate::blog;
use crate::scheduler::Scheduler;
use sqlx::{Pool, Postgres};
pub fn start() {
pub fn start(db_pool: Pool<Postgres>) {
let scheduler = Scheduler::new();
let _ = vec![blog::cron::get_tasks()]
let _ = vec![blog::cron::get_tasks(db_pool.clone())]
.into_iter()
.map(|list| scheduler.insert_list(list))
.collect::<Vec<_>>();