move delay option into trigger root

This commit is contained in:
Robin Appelman 2020-01-25 14:55:53 +01:00
commit 8a7f023631
4 changed files with 4 additions and 4 deletions

View file

@ -54,7 +54,6 @@ pub struct Action {
pub method: Method,
pub params: HashMap<String, Parameter>,
pub url: String,
pub delay: u64,
}
#[derive(Debug, Clone, Deserialize)]
@ -72,6 +71,7 @@ pub struct PrometheusConfig {
#[derive(Debug, Clone, Deserialize)]
pub struct Trigger {
pub name: String,
pub delay: u64,
pub condition: Condition,
pub action: Action,
}

View file

@ -53,7 +53,7 @@ impl TriggerManager {
}
async fn run_trigger(&self, trigger: &Trigger) -> Result<(), MainError> {
let delay = trigger.action.delay;
let delay = trigger.delay;
let delay_duration = Duration::from_secs(delay);
let error_delay = Duration::from_secs(15);
loop {