mirror of
https://codeberg.org/icewind/prometheus-edge-trigger.git
synced 2026-06-03 18:24:10 +02:00
move delay option into trigger root
This commit is contained in:
parent
fe92c27bc6
commit
8a7f023631
4 changed files with 4 additions and 4 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue