diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-09-07 16:11:45 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-09-07 16:11:45 -0400 |
commit | a772e82911aa1a95d763ed682aa0ee7d648dcb2a (patch) | |
tree | d3e2d9e5bd9ed1886165fa5b44d285f81544fda8 /src | |
parent | 28372f93072c9474278d490cfbaa9729e9fd72d8 (diff) | |
download | instistats-a772e82911aa1a95d763ed682aa0ee7d648dcb2a.tar.gz |
added last generated timestamp
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 138ea5c..605db66 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +use chrono::prelude::*; use std::env; use std::fs; use std::path::Path; @@ -19,6 +20,7 @@ struct Server { want_users: bool, admin_email: String, description: String, + last_generated: String, users: Vec<User>, } @@ -122,6 +124,8 @@ fn main() { let conf_yaml: serde_yaml::Value = serde_yaml::from_str(&conf).expect("Could not parse config data as YAML"); + let last_generated = Utc::now().to_rfc2822(); + let mut conf_yaml = Server { name: conf_yaml["name"].as_str().unwrap().to_string(), url: conf_yaml["url"].as_str().unwrap().to_string(), @@ -130,6 +134,7 @@ fn main() { want_users: conf_yaml["want_users"].as_bool().unwrap(), admin_email: conf_yaml["admin_email"].as_str().unwrap().to_string(), description: conf_yaml["description"].as_str().unwrap().to_string(), + last_generated, users: Vec::new(), }; |