mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-25 00:33:37 +05:00
fix(InstanceManager): return an updated list when getting the instances property
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -82,10 +82,7 @@ class InstanceManager:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def instances(self) -> List[I]:
|
def instances(self) -> List[I]:
|
||||||
if not self._instances:
|
return self.find_instances()
|
||||||
self._instances = self.find_instances()
|
|
||||||
|
|
||||||
return sorted(self._instances, key=lambda x: self._sort_instance_list(x.suffix))
|
|
||||||
|
|
||||||
@instances.setter
|
@instances.setter
|
||||||
def instances(self, value: List[I]):
|
def instances(self, value: List[I]):
|
||||||
@@ -205,7 +202,7 @@ class InstanceManager:
|
|||||||
for service in service_list
|
for service in service_list
|
||||||
]
|
]
|
||||||
|
|
||||||
return instance_list
|
return sorted(instance_list, key=lambda x: self._sort_instance_list(x.suffix))
|
||||||
|
|
||||||
def _get_instance_suffix(self, file_path: Path) -> str:
|
def _get_instance_suffix(self, file_path: Path) -> str:
|
||||||
return file_path.stem.split("-")[-1] if "-" in file_path.stem else ""
|
return file_path.stem.split("-")[-1] if "-" in file_path.stem else ""
|
||||||
|
|||||||
Reference in New Issue
Block a user