From ec777652c17ccefed9b332b13e7a233de1a32867 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 22 May 2020 15:19:49 +0200 Subject: Better retry mechanism --- src/consul.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/consul.rs') diff --git a/src/consul.rs b/src/consul.rs index 01dff46..1bb30aa 100644 --- a/src/consul.rs +++ b/src/consul.rs @@ -27,6 +27,10 @@ impl Consul { }; } + pub fn watch_node_reset(&mut self) -> () { + self.idx = None; + } + pub async fn watch_node(&mut self, host: &str) -> Result { let url = match self.idx { Some(i) => format!("{}/v1/catalog/node/{}?index={}", self.url, host, i), -- cgit v1.2.3