Compare commits
2 Commits
6d4bc81720
...
03073965a1
Author | SHA1 | Date | |
---|---|---|---|
03073965a1 | |||
2189b082c0 |
@ -3,7 +3,7 @@ mod waterlevel;
|
||||
use std::time::Duration;
|
||||
|
||||
use job_scheduler_ng::{Job, JobScheduler};
|
||||
use rocket::tokio::{self, task};
|
||||
use rocket::tokio::{self, task, time};
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
pub fn schedule(db: &SqlitePool) {
|
||||
@ -26,9 +26,10 @@ pub fn schedule(db: &SqlitePool) {
|
||||
});
|
||||
}));
|
||||
|
||||
let mut interval = time::interval(Duration::from_secs(60));
|
||||
loop {
|
||||
sched.tick();
|
||||
std::thread::sleep(Duration::from_secs(60));
|
||||
interval.tick().await;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user