// Checks if a task list exists in an active mode and stops its scheduler if needed
Checks if a task list exists in an active mode and stops its scheduler if needed
Checks if a task list exists in an active mode and stops its scheduler if needed
pub fn check_stop_task_list(
        &self,
        raw_name: &str,
        raw_mode: &str,
    ) -> Result<(), SchedulerError> {
        let name = raw_name.to_lowercase();
        let mode = raw_mode.to_lowercase();
        if is_mode_active(&self.scheduler_dir, &mode) {
            let mut schedules_map = self.scheduler_map.lock().unwrap();
            if let Some(handle) = schedules_map.remove(&name) {
                info!("Stopping {}'s tasks", name);
                if let Err(_) = handle.stopper.send(()) {
                    error!("Failed to send stop to {}'s tasks", name);
                }
            }
            Ok(())
        } else {
            Ok(())
        }
    }
pub fn check_stop_task_list ( & self , raw_name : & str , raw_mode : & str , ) -> Result < ( ) , SchedulerError > { let name = raw_name . to_lowercase ( ) ; let mode = raw_mode . to_lowercase ( ) ; if is_mode_active ( & self . scheduler_dir , & mode ) { let mut schedules_map = self . scheduler_map . lock ( ) . unwrap ( ) ; if let Some ( handle ) = schedules_map . remove ( & name ) { info ! ( " " name ) ; if let Err ( _ ) = handle . stopper . send ( ( ) ) { error ! ( " " name ) ; } } Ok ( ( ) ) } else { Ok ( ( ) ) } }
Checks if a task list exists in an active mode and stops its scheduler if needed
Checks if a task list exists in an active mode and stops its scheduler if needed
&self
raw_name
&str
raw_mode
&str