mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-18 10:56:21 +00:00
feat(init::schema) init database schema
This commit is contained in:
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") {
|
||||
|
||||
@@ -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(),
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user