diff --git a/src/admin/server.rs b/src/admin/server.rs index 1c3cfe6..2b32fda 100644 --- a/src/admin/server.rs +++ b/src/admin/server.rs @@ -123,12 +123,12 @@ impl AdminServiceImpl { self.endpoint(&reentry) } - pub fn app_entries(&self, name: String) -> anyhow::Result> { + pub fn app_entries(&self, name: &str) -> anyhow::Result> { if name.contains('@') { - let list = self.registry.find_names(&name)?; + let list = self.registry.find_names(name)?; Ok(list) } else { - Ok(vec![name]) + Ok(vec![name.to_owned()]) } } @@ -423,10 +423,10 @@ impl pb::admin_service_server::AdminService for AdminService { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status> { - escalate(request, |req| async { + escalate(request, |req| async move { let agent = self.inner.agent_endpoint(&req.app_name)?; let client = SystemDClient::new(agent); - for each in self.inner.app_entries(req.app_name)? { + for each in self.inner.app_entries(&req.app_name)? { _ = client.pause_remote(each).await? } app_success() @@ -437,10 +437,10 @@ impl pb::admin_service_server::AdminService for AdminService { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status> { - escalate(request, |req| async { + escalate(request, |req| async move { let agent = self.inner.agent_endpoint(&req.app_name)?; let client = SystemDClient::new(agent); - for each in self.inner.app_entries(req.app_name)? { + for each in self.inner.app_entries(&req.app_name)? { _ = client.resume_remote(each).await? } app_success() @@ -451,10 +451,10 @@ impl pb::admin_service_server::AdminService for AdminService { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status> { - escalate(request, |req| async { + escalate(request, |req| async move { let agent = self.inner.agent_endpoint(&req.app_name)?; let client = SystemDClient::new(agent); - for each in self.inner.app_entries(req.app_name)? { + for each in self.inner.app_entries(&req.app_name)? { _ = client.stop_remote(each).await? } app_success()