diff --git a/apps/jingrow/jingrow/config.py b/apps/jingrow/jingrow/config.py index 5e1be46..998c1db 100644 --- a/apps/jingrow/jingrow/config.py +++ b/apps/jingrow/jingrow/config.py @@ -46,6 +46,7 @@ class Settings(BaseSettings): # 异步任务队列(Dramatiq)配置 worker_processes: int = 1 worker_threads: int = 1 + watch: bool = True class Config: env_file = str(Path(__file__).resolve().parents[3] / '.env') diff --git a/apps/jingrow/jingrow/dramatiq.py b/apps/jingrow/jingrow/dramatiq.py index 0df7409..6b268c0 100644 --- a/apps/jingrow/jingrow/dramatiq.py +++ b/apps/jingrow/jingrow/dramatiq.py @@ -20,6 +20,11 @@ def main() -> None: "--threads", str(threads), ] + # 仅从 Config.watch 控制是否启用 watch,目录固定为 apps 根目录 + if bool(getattr(Config, "watch", False)): + current_dir = os.path.dirname(__file__) + apps_dir = os.path.abspath(os.path.join(current_dir, "..", "..")) + args.extend(["--watch", apps_dir]) os.execvp("dramatiq", args) diff --git a/apps/jingrow/pyproject.toml b/apps/jingrow/pyproject.toml index f5a6bd2..c4c0cd2 100644 --- a/apps/jingrow/pyproject.toml +++ b/apps/jingrow/pyproject.toml @@ -9,4 +9,6 @@ dependencies = [ "pydantic-settings>=2.0.0", "qdrant-client==1.15.1", "requests==2.31.0", + "dramatiq", + "dramatiq[watch]", ] diff --git a/package.json b/package.json index 322c610..a7ec691 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jingrow", "version": "1.0.0", - "description": "AI Agent工作流平台", + "description": "AI Agent Framework", "scripts": { "dev": "./dev.sh start", "stop": "./dev.sh stop",