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

@@ -1,4 +1,6 @@
pub fn task() {
use sqlx::{Pool, Postgres};
pub fn task(db_connection: &Pool<Postgres>) {
// get dir
// let git_work_dir_path = &env::var("GIT_WORK_DIR").unwrap_or_else(|e| {
// if let Ok(default_log_path) = env::var("WORK_DIR") {
+8 -4
View File
@@ -1,10 +1,14 @@
use crate::scheduler::tasks::basic::BasicTask;
use crate::scheduler::tasks::Task;
use sqlx::{Pool, Postgres};
pub mod check_update;
pub fn get_tasks() -> Vec<Box<dyn Task>> {
vec![BasicTask::new(check_update::task, "* * * * * *")
.unwrap()
.to_task()]
pub fn get_tasks(db_connection: Pool<Postgres>) -> Vec<Box<dyn Task>> {
let db_conn_clone = db_connection.clone();
vec![
BasicTask::new(move || check_update::task(&db_conn_clone), "* * * * * *")
.unwrap()
.to_task(),
]
}