# HG changeset patch # User Matt Johnston # Date 1571236386 -28800 # Node ID 43eb3cfdf76982a57134e1f3275fe4c2e85b3d3a # Parent 4424a8b30f9c10a9e320faa774b0685c90b77c1e some progress, better error handling diff -r 4424a8b30f9c -r 43eb3cfdf769 rust/src/config.rs --- a/rust/src/config.rs Sun Sep 22 22:06:46 2019 +0800 +++ b/rust/src/config.rs Wed Oct 16 22:33:06 2019 +0800 @@ -43,7 +43,6 @@ }) })?; c.merge(config::Environment::with_prefix("TEMPLOG")).unwrap(); - println!("c is {:?}", c); - Ok(c.try_into().unwrap()) + c.try_into().or_else(|e| Err(TemplogError::new(&format!("Problem loading config {}: {}", conf_file, e)))) } } diff -r 4424a8b30f9c -r 43eb3cfdf769 rust/src/fridge.rs --- a/rust/src/fridge.rs Sun Sep 22 22:06:46 2019 +0800 +++ b/rust/src/fridge.rs Wed Oct 16 22:33:06 2019 +0800 @@ -171,6 +171,7 @@ FridgeControl::Fake => debug!("fridge turns {}", if on {"on"} else {"off"}), } self.on = on; + self.integrator.turn(on) } // Turns the fridge off and on diff -r 4424a8b30f9c -r 43eb3cfdf769 rust/src/params.rs --- a/rust/src/params.rs Sun Sep 22 22:06:46 2019 +0800 +++ b/rust/src/params.rs Wed Oct 16 22:33:06 2019 +0800 @@ -19,8 +19,6 @@ // for try_concat() use futures::stream::TryStreamExt; use futures::executor::block_on; -// for block_on().or_else -use futures_util::try_future::TryFutureExt; use riker::actors::*; @@ -181,7 +179,9 @@ ctx.schedule_once(Duration::from_secs(1), ctx.myself(), None, PollForParams); if let Err(e) = self.do_poll(ctx) { - warn!("Problem fetching params: {}", e); + self.limitlog.and_then(|| { + warn!("Problem fetching params: {}", e) + }); } }