removed some deps, using heap to store the current ringer (makes it more dynamic)

This commit is contained in:
2026-03-02 20:54:34 +01:00
parent a86a28fd85
commit 8ed9d872dc
7 changed files with 68 additions and 968 deletions

View File

@@ -9,16 +9,16 @@ use crate::ringer::Ringer;
use crate::types::Alarm;
#[derive(Debug)]
pub struct Scheduler<T: Ringer + 'static> {
ringer: Arc<Mutex<T>>,
pub struct Scheduler {
ringer: Arc<Mutex<dyn Ringer>>,
cron: Arc<Mutex<Cron<Local>>>,
alarms: Arc<Mutex<Vec<Alarm>>>,
db: Arc<DatabaseConnection>,
}
impl<T: Ringer> Scheduler<T> {
impl Scheduler {
pub fn new(
ringer: Arc<Mutex<T>>,
ringer: Arc<Mutex<dyn Ringer>>,
cron: Arc<Mutex<Cron<Local>>>,
db: Arc<DatabaseConnection>,
) -> Self {