fix: CLI lazy NeuralScorer import (torch only on demand), health_check use subprocess.run for systemctl
This commit is contained in:
@@ -49,17 +49,14 @@ def get_backup_status():
|
|||||||
|
|
||||||
def get_job_status():
|
def get_job_status():
|
||||||
units = [
|
units = [
|
||||||
"openclaw-secondbrain-ingest-memory.service",
|
"openclaw-worker@secondbrain_manager.service", # aktueller Worker-Dienst
|
||||||
"openclaw-secondbrain-index-vectors.service",
|
"secondbrain-dashboard.service", # Dashboard
|
||||||
"openclaw-secondbrain-review.service",
|
|
||||||
"openclaw-secondbrain-heartbeat.service",
|
|
||||||
"openclaw-secondbrain-verify-pending.service",
|
|
||||||
]
|
]
|
||||||
status = {}
|
status = {}
|
||||||
for u in units:
|
for u in units:
|
||||||
try:
|
try:
|
||||||
out = subprocess.check_output(["systemctl", "is-active", u], text=True, stderr=subprocess.DEVNULL).strip()
|
out = subprocess.run(["systemctl", "is-active", u], capture_output=True, text=True, check=False)
|
||||||
status[u] = out
|
status[u] = out.stdout.strip() or "inactive"
|
||||||
except Exception:
|
except Exception:
|
||||||
status[u] = "unknown"
|
status[u] = "unknown"
|
||||||
return status
|
return status
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ from .engram import Engram, Grounding
|
|||||||
from .retriever import Retriever
|
from .retriever import Retriever
|
||||||
from .chroma_store import ChromaStore
|
from .chroma_store import ChromaStore
|
||||||
from .graph_view import generate_graph_html
|
from .graph_view import generate_graph_html
|
||||||
from .neural_scorer import NeuralScorer
|
|
||||||
from .loop_detector import LoopDetector
|
from .loop_detector import LoopDetector
|
||||||
from .error_healer import ErrorHealer
|
from .error_healer import ErrorHealer
|
||||||
|
|
||||||
@@ -209,6 +208,7 @@ def cmd_heal(args):
|
|||||||
|
|
||||||
|
|
||||||
def cmd_neural_train(args):
|
def cmd_neural_train(args):
|
||||||
|
from .neural_scorer import NeuralScorer # lazy: needs torch
|
||||||
store = get_store()
|
store = get_store()
|
||||||
scorer = NeuralScorer()
|
scorer = NeuralScorer()
|
||||||
egs = store.get_all(limit=10000)
|
egs = store.get_all(limit=10000)
|
||||||
|
|||||||
Reference in New Issue
Block a user