aboutsummaryrefslogtreecommitdiff
path: root/src/consul.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-05-22 15:19:49 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-05-22 15:19:49 +0200
commitec777652c17ccefed9b332b13e7a233de1a32867 (patch)
tree758a6e3016c3ee54611f7008b6f067117ec6125a /src/consul.rs
parent28b661aa47dcdae680847635115c0e0b18a7c67b (diff)
downloaddiplonat-ec777652c17ccefed9b332b13e7a233de1a32867.tar.gz
diplonat-ec777652c17ccefed9b332b13e7a233de1a32867.zip
Better retry mechanism
Diffstat (limited to 'src/consul.rs')
-rw-r--r--src/consul.rs4
1 files changed, 4 insertions, 0 deletions
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<CatalogNode> {
let url = match self.idx {
Some(i) => format!("{}/v1/catalog/node/{}?index={}", self.url, host, i),