feat(backend) scheduler rewrite (deadlock for now)

This commit is contained in:
lumither committed 2025-03-05 13:52:07 -08:00
1 parent 0c6325d5f2
commit 5e8b1ff35d
8 files changed
+267 -139

No files matched your search

+3 -4
View File
@@ -1,5 +1,4 @@
use std::error::Error;
use std::str::FromStr;
use std::{error::Error, pin::Pin, str::FromStr};
use crate::scheduler::{task_func::TaskFunc, tasks::CronTask};
@@ -32,7 +31,7 @@ impl CronTask for BasicTask {
self.schedule.upcoming(Utc).next()
}
fn call(&self) {
(self.func)()
fn call(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>> {
Box::pin(async { (self.func)() })
}
}