diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-04-11 04:37:17 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-04-11 04:39:34 -0400 |
commit | 763789f029b3be8e32efc49e9a94f61bf139ec3e (patch) | |
tree | 9fa1d38d0005f26367ce138e86f24cc166e7b269 /src/bin | |
parent | c38b48749cd33d02349cd950149d4413c8469cb4 (diff) | |
download | rbw-763789f029b3be8e32efc49e9a94f61bf139ec3e.tar.gz rbw-763789f029b3be8e32efc49e9a94f61bf139ec3e.zip |
read lock timeout from config
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/agent.rs | 3 | ||||
-rw-r--r-- | src/bin/rbw.rs | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/agent.rs b/src/bin/agent.rs index b233403..9d4f7c5 100644 --- a/src/bin/agent.rs +++ b/src/bin/agent.rs @@ -163,9 +163,10 @@ struct State { impl Agent { fn new() -> Self { + let config = rbw::config::Config::load().unwrap(); Self { timeout: tokio::time::delay_for( - tokio::time::Duration::from_secs(600), // read from config + tokio::time::Duration::from_secs(config.lock_timeout), ), state: std::sync::Arc::new(tokio::sync::RwLock::new(State { priv_key: None, diff --git a/src/bin/rbw.rs b/src/bin/rbw.rs index e23d005..9a968ff 100644 --- a/src/bin/rbw.rs +++ b/src/bin/rbw.rs @@ -95,6 +95,7 @@ fn config_set(key: &str, value: &str) { "email" => config.email = Some(value.to_string()), "base_url" => config.base_url = Some(value.to_string()), "identity_url" => config.identity_url = Some(value.to_string()), + "lock_timeout" => config.lock_timeout = value.parse().unwrap(), _ => unimplemented!(), } config.save().unwrap(); |