Files
FishServer/fish_api/app/action_watch_cli.py
zaiun xu d0c53068dd feat(fish_api): add FishAction folder watch via Pydantic settings
Add ACTION_WATCH_* settings, background watch loop in FastAPI lifespan,
and shared action_watch service that updates app_state. Add fish-action-watch
CLI and optional FishAction watch_folder_predict.py for standalone use.

Made-with: Cursor
2026-04-08 19:54:18 +08:00

25 lines
619 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""独立进程:仅根据 .env / 环境变量中的 action_watch_dir 跑目录监控(不启动 FastAPI"""
from __future__ import annotations
import asyncio
import sys
from app.services.action_watch import run_action_watch_loop
from app.settings import get_settings
def main() -> None:
s = get_settings()
if s.action_watch_dir is None:
print(
"未配置监控目录:请在 .env 中设置 ACTION_WATCH_DIR=/你的/mp4/目录",
file=sys.stderr,
)
raise SystemExit(1)
asyncio.run(run_action_watch_loop(s))
if __name__ == "__main__":
main()