Remove a compute instance. # Panics Panics if the identified `instance` still has active replicas.
(&mut self, id: ComputeInstanceId)
| 589 | /// |
| 590 | /// Panics if the identified `instance` still has active replicas. |
| 591 | pub fn drop_instance(&mut self, id: ComputeInstanceId) { |
| 592 | if let Some(instance) = self.instances.remove(&id) { |
| 593 | instance.call(|i| i.shutdown()); |
| 594 | } |
| 595 | |
| 596 | self.instance_workload_classes |
| 597 | .lock() |
| 598 | .expect("lock poisoned") |
| 599 | .remove(&id); |
| 600 | } |
| 601 | |
| 602 | /// Returns the compute controller's config set. |
| 603 | pub fn dyncfg(&self) -> &Arc<ConfigSet> { |