init commit

This commit is contained in:
zyhe
2026-03-16 11:44:10 +00:00
commit 94384a93c9
552 changed files with 363038 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
from functools import wraps
from nimbus.daemon import ComponentStatus, StatusReporter
def status_monitor(running_status=ComponentStatus.RUNNING, completed_status=ComponentStatus.COMPLETED):
def decorator(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
if not hasattr(self, "status_reporter"):
self.status_reporter = StatusReporter(self.__class__.__name__)
self.status_reporter.update_status(running_status)
try:
result = func(self, *args, **kwargs)
self.status_reporter.update_status(completed_status)
return result
except Exception as e:
raise e
return wrapper
return decorator