aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2019-03-19 10:41:42 +0200
committerHristo Venev <hristo@venev.name>2019-03-19 10:41:42 +0200
commitddd8e2d68bed2bd9efb8379a345bd99eaebd3795 (patch)
treed0459f74d743363b5aab75bf59d6d121c60924c8 /src/main.rs
parent7eef7ad915a608f5cad510d079b9240ed11698f1 (diff)
refresh_period = ... -> refresh_sec = ...
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index d556064..14018e8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -53,16 +53,12 @@ impl Device {
})
}
- fn refresh_period(&self) -> Duration {
- Duration::from_secs(u64::from(self.update_config.refresh_period))
- }
-
fn make_config(
&self,
public_key: &str,
ts: SystemTime,
) -> (wg::Config, Vec<wg::ConfigError>, SystemTime) {
- let mut t_cfg = ts + self.refresh_period();
+ let mut t_cfg = ts + Duration::from_secs(1 << 30);
let mut sources: Vec<(&Source, &proto::SourceConfig)> = vec![];
for src in self.sources.iter() {
if let Some(ref data) = src.data {
@@ -100,7 +96,7 @@ impl Device {
}
pub fn update(&mut self) -> io::Result<Instant> {
- let refresh = self.refresh_period();
+ let refresh = Duration::from_secs(u64::from(self.update_config.refresh_sec));
let mut now = Instant::now();
let mut t_refresh = now + refresh;