mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 13:09:25 +08:00
fix: use lazy import to avoid circular import between process manager and instance watcher
This commit is contained in:
@@ -233,9 +233,6 @@ class ProcessManager:
|
||||
logger.info("Start alas complete")
|
||||
|
||||
|
||||
from module.instance_watcher import InstanceWatcher
|
||||
|
||||
|
||||
class ProcessManager(ProcessManager):
|
||||
class DetailInstanceStatus:
|
||||
Alive = 1
|
||||
@@ -246,10 +243,12 @@ class ProcessManager(ProcessManager):
|
||||
Error = 6
|
||||
|
||||
def start(self, *args, **kwargs):
|
||||
from module.instance_watcher import InstanceWatcher
|
||||
super().start(*args, **kwargs)
|
||||
InstanceWatcher.get_instance().try_add_instance(self.config_name)
|
||||
|
||||
def stop(self, *args, **kwargs):
|
||||
from module.instance_watcher import InstanceWatcher
|
||||
InstanceWatcher.get_instance().remove_instance(self.config_name, remove_status_cache_file=kwargs.get("remove_status_cache_file", False))
|
||||
kwargs.pop("remove_status_cache_file", None)
|
||||
super().stop(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user