refactor(controller): use state to find available port range
This commit is contained in:
@@ -88,8 +88,8 @@ impl StateManager {
|
||||
self.0.borrow_mut().instances.insert(project_name, state);
|
||||
}
|
||||
|
||||
pub fn remove(&self, project_name: &str) -> Option<InstanceState> {
|
||||
self.0.borrow_mut().instances.remove(project_name)
|
||||
pub fn get_highest_used_port(&self) -> Option<u16> {
|
||||
self.0.borrow().instances.values().map(|i| i.port).max()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user