corrected error with validate_attr
This commit is contained in:
parent
5c35ad114a
commit
66195138f8
2 changed files with 55 additions and 16 deletions
|
@ -580,7 +580,7 @@ impl BotActionTrait for Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
// #[derive(Debug, PartialEq, Eq, Hash, Clone)]
|
// #[derive(Debug, PartialEq, Eq, Hash, Clone)]
|
||||||
#[derive(PartialEq, Eq, Hash)]
|
#[derive(Debug, PartialEq, Eq, Hash)]
|
||||||
pub enum RoutineAttr {
|
pub enum RoutineAttr {
|
||||||
DelayedStart,
|
DelayedStart,
|
||||||
ScheduledStart(DateTime<Local>), // Scheduled Date (if any) after which, if not started, may trigger
|
ScheduledStart(DateTime<Local>), // Scheduled Date (if any) after which, if not started, may trigger
|
||||||
|
@ -718,17 +718,35 @@ impl Routine {
|
||||||
// }
|
// }
|
||||||
// );
|
// );
|
||||||
|
|
||||||
|
let mut attribute_supported = false;
|
||||||
|
|
||||||
for given_routine in routine_attr {
|
for given_routine in routine_attr {
|
||||||
|
|
||||||
if !matches!(given_routine,RoutineAttr::DelayedStart)
|
// if !matches!(given_routine,RoutineAttr::DelayedStart)
|
||||||
&& !matches!(given_routine,RoutineAttr::ScheduledStart(_))
|
// && !matches!(given_routine,RoutineAttr::ScheduledStart(_))
|
||||||
&& !matches!(given_routine,RoutineAttr::LoopDuration(_))
|
// && !matches!(given_routine,RoutineAttr::LoopDuration(_))
|
||||||
&& !matches!(given_routine,RoutineAttr::LoopInfinitely)
|
// && !matches!(given_routine,RoutineAttr::LoopInfinitely)
|
||||||
&& !matches!(given_routine,RoutineAttr::RunOnce)
|
// && !matches!(given_routine,RoutineAttr::RunOnce)
|
||||||
&& !matches!(given_routine,RoutineAttr::MaxTimeThreshold(_))
|
// && !matches!(given_routine,RoutineAttr::MaxTimeThreshold(_))
|
||||||
&& !matches!(given_routine,RoutineAttr::MaxIterations(_))
|
// && !matches!(given_routine,RoutineAttr::MaxIterations(_))
|
||||||
|
if matches!(given_routine,RoutineAttr::DelayedStart)
|
||||||
|
|| matches!(given_routine,RoutineAttr::ScheduledStart(_))
|
||||||
|
|| matches!(given_routine,RoutineAttr::LoopDuration(_))
|
||||||
|
|| matches!(given_routine,RoutineAttr::LoopInfinitely)
|
||||||
|
|| matches!(given_routine,RoutineAttr::RunOnce)
|
||||||
|
|| matches!(given_routine,RoutineAttr::MaxTimeThreshold(_))
|
||||||
|
|| matches!(given_routine,RoutineAttr::MaxIterations(_))
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
attribute_supported = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if !attribute_supported {
|
||||||
botlog::trace(
|
botlog::trace(
|
||||||
"[ERROR][Routine Feature NOT IMPLEMENTED]",
|
"[ERROR][Routine Feature NOT IMPLEMENTED]",
|
||||||
Some("Routine > Validate_attr()".to_string()),
|
Some("Routine > Validate_attr()".to_string()),
|
||||||
|
@ -737,10 +755,21 @@ impl Routine {
|
||||||
|
|
||||||
Log::flush();
|
Log::flush();
|
||||||
|
|
||||||
|
botlog::trace(
|
||||||
|
format!(
|
||||||
|
"[ERROR][Routine Feature NOT IMPLEMENTED] > Problem Routine - {:?}"
|
||||||
|
,routine_attr).as_str(),
|
||||||
|
Some("Routine > Validate_attr()".to_string()),
|
||||||
|
None,
|
||||||
|
);
|
||||||
|
|
||||||
|
Log::flush();
|
||||||
|
|
||||||
return Err("NOT IMPLEMENTED".to_string());
|
return Err("NOT IMPLEMENTED".to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -809,7 +838,7 @@ impl Routine {
|
||||||
// {
|
// {
|
||||||
|
|
||||||
botlog::trace(
|
botlog::trace(
|
||||||
"[ERROR][Routine Feature NOT IMPLEMENTED]",
|
"[OK][Implemented & Validated]",
|
||||||
Some("Routine > Validate_attr()".to_string()),
|
Some("Routine > Validate_attr()".to_string()),
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|
|
@ -191,6 +191,16 @@ async fn countdown_chnl_v1(params : ExecBodyParams) {
|
||||||
// Some(a) => a,
|
// Some(a) => a,
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
// let routine_lock = arr.read().await;
|
||||||
|
// if let Some(a) = routine_lock.remaining_iterations.clone() {
|
||||||
|
// println!("Remaining iterations > {}",a)
|
||||||
|
// }
|
||||||
|
|
||||||
|
{
|
||||||
|
let routine_lock = arr.write().await;
|
||||||
|
let a = routine_lock.remaining_iterations;
|
||||||
|
println!("remaining iterations : {:?}", a);
|
||||||
|
}
|
||||||
|
|
||||||
botlog::trace(
|
botlog::trace(
|
||||||
"after loading remaining iterations",
|
"after loading remaining iterations",
|
||||||
|
|
Loading…
Reference in a new issue