diff options
author | adrien <adrien@luxeylab.net> | 2021-09-10 18:41:39 +0200 |
---|---|---|
committer | adrien <adrien@luxeylab.net> | 2021-09-10 18:41:39 +0200 |
commit | 4d76c3d78ade04038593aeef867294c9eee2a4b8 (patch) | |
tree | 8fac4937beafb831b7354bb2afa37bb5bea99e00 /src/config/runtime.rs | |
parent | 195aec2cfe738f4025ea540d2591f876e1d209b9 (diff) | |
download | diplonat-4d76c3d78ade04038593aeef867294c9eee2a4b8.tar.gz diplonat-4d76c3d78ade04038593aeef867294c9eee2a4b8.zip |
wrote the skeleton of ACME. Involved solving the cosmetic warnings about CamelCase for enums (without changing the API).
Diffstat (limited to 'src/config/runtime.rs')
-rw-r--r-- | src/config/runtime.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/config/runtime.rs b/src/config/runtime.rs index f83a6b5..ee7f682 100644 --- a/src/config/runtime.rs +++ b/src/config/runtime.rs @@ -20,6 +20,7 @@ pub struct RuntimeConfigConsul { #[derive(Debug)] pub struct RuntimeConfigAcme { pub email: String, + pub refresh_time: Duration, } #[derive(Debug)] @@ -79,9 +80,12 @@ impl RuntimeConfigAcme { let email = opts.email.expect( "'DIPLONAT_ACME_EMAIL' is required if ACME is enabled"); + let refresh_time = Duration::from_secs( + opts.refresh_time.unwrap_or(super::REFRESH_TIME).into()); Ok(Some(Self { email, + refresh_time, })) } } |