Mercurial > templog
comparison rust/src/params.rs @ 636:43eb3cfdf769 rust
some progress, better error handling
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 16 Oct 2019 22:33:06 +0800 |
parents | 4424a8b30f9c |
children | a9f353f488d0 |
comparison
equal
deleted
inserted
replaced
635:4424a8b30f9c | 636:43eb3cfdf769 |
---|---|
17 use hyper; | 17 use hyper; |
18 | 18 |
19 // for try_concat() | 19 // for try_concat() |
20 use futures::stream::TryStreamExt; | 20 use futures::stream::TryStreamExt; |
21 use futures::executor::block_on; | 21 use futures::executor::block_on; |
22 // for block_on().or_else | |
23 use futures_util::try_future::TryFutureExt; | |
24 | 22 |
25 use riker::actors::*; | 23 use riker::actors::*; |
26 | 24 |
27 use super::types::*; | 25 use super::types::*; |
28 use super::config::Config; | 26 use super::config::Config; |
179 _sender: Sender) { | 177 _sender: Sender) { |
180 // schedule a retry once this iteration finishes | 178 // schedule a retry once this iteration finishes |
181 ctx.schedule_once(Duration::from_secs(1), ctx.myself(), None, PollForParams); | 179 ctx.schedule_once(Duration::from_secs(1), ctx.myself(), None, PollForParams); |
182 | 180 |
183 if let Err(e) = self.do_poll(ctx) { | 181 if let Err(e) = self.do_poll(ctx) { |
184 warn!("Problem fetching params: {}", e); | 182 self.limitlog.and_then(|| { |
183 warn!("Problem fetching params: {}", e) | |
184 }); | |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 fn pre_start(&mut self, ctx: &Context<Self::Msg>) { | 188 fn pre_start(&mut self, ctx: &Context<Self::Msg>) { |
189 self.chan = Some(channel("params", &ctx.system).unwrap()); | 189 self.chan = Some(channel("params", &ctx.system).unwrap()); |