feat: 只保留管理入口,缓存小区信息表解析,连接中显示提示,移除脚本管理打包方式

This commit is contained in:
2026-11-12 11:53:12 +08:00
parent 5bcf5cfa89
commit 1c5c32bfdc
19 changed files with 317 additions and 457 deletions
+14
View File
@@ -46,6 +46,7 @@ class Runner:
self.data_dir = data_dir
self.output_dir = data_dir / "output"
self.log_dir = data_dir / "logs"
self.cache_dir = data_dir / "cache" / "cell-data"
self.command = command or [sys.executable, "-m", "etl_app.worker"]
self.seconds_per_minute = 60.0
self._lock = threading.Lock()
@@ -101,6 +102,17 @@ class Runner:
def _finish(self, run_id: int, dry_run: bool) -> None:
try:
self._execute(run_id, dry_run)
except Exception as exc:
# A record that never got its result would stay "running" until the next restart.
record = self.runs.get(run_id)
if record is not None and record["status"] == "running":
self.runs.finish(
run_id,
status="failed",
finished_at=now_text(),
detail=f"{type(exc).__name__}: {exc}"[:DETAIL_LIMIT],
)
raise
finally:
self._process = None
self._current = None
@@ -125,6 +137,8 @@ class Runner:
str(self.settings_store.path),
"--output",
str(self.output_dir),
"--cache",
str(self.cache_dir),
*(["--dry-run"] if dry_run else []),
]
env = {key: value for key, value in os.environ.items() if key != "METRIX_APP_PROXY_TOKEN"}