Extract get_cert

This commit is contained in:
Adrian Heine 2019-12-11 21:56:02 +01:00
parent 51b47b5dd4
commit ffd85372d3

View file

@ -59,9 +59,13 @@ impl<'b, C: 'b + CommandRunner, P: 'b + Policy> SymbolFactory<'b, C, P> {
} }
} }
pub fn get_nginx_acme_server<'a, 'c: 'a, S: 'a + Symbol>( pub fn get_cert<'a, H: 'a + AsRef<str> + Clone>(&'a self, host: H) -> impl Symbol + 'a {
&'c self, self.acme_factory.get_cert(host)
host: &'static str, }
pub fn get_nginx_acme_server<'a, S: 'a + Symbol>(
&'a self,
host: &'a str,
nginx_server_symbol: S, nginx_server_symbol: S,
) -> impl Symbol + 'a { ) -> impl Symbol + 'a {
List::from(( List::from((
@ -71,7 +75,7 @@ impl<'b, C: 'b + CommandRunner, P: 'b + Policy> SymbolFactory<'b, C, P> {
ReloadService::new("nginx", self.command_runner), ReloadService::new("nginx", self.command_runner),
), ),
Hook::new( Hook::new(
self.acme_factory.get_cert(host), self.get_cert(host),
ReloadService::new("nginx", self.command_runner), ReloadService::new("nginx", self.command_runner),
), ),
)) ))