- 新增 SQLite:measure/health 快照、delivery_cursor 单消费者 pop;clear/start_fresh 可清空库 - biomass GET 仅返回约定 data 字段,X-Fish-Biomass-New 表示是否有新快照;poller 读响应头 - loguru 桥接 uvicorn,子进程 stdout 流式输出;format_json_pretty 与算法摘要日志 - measure/action watch 无新任务时限流 WARNING;watch_idle 共用逻辑 - 依赖 loguru;新增 db、logging_config、subprocess_run、watch_idle、启动脚本 FishMeasure: 更新 fish_video_weight_evaluation 与 predict_weigth_from_svo2;移除未用 refbox/segmentation 脚本 Made-with: Cursor
27 lines
661 B
Python
27 lines
661 B
Python
"""独立进程:仅根据 .env / 环境变量中的 action_watch_dir 跑目录监控(不启动 FastAPI)。"""
|
||
|
||
from __future__ import annotations
|
||
|
||
import asyncio
|
||
import sys
|
||
|
||
from app.db import init_db
|
||
from app.services.action_watch import run_action_watch_loop
|
||
from app.settings import get_settings
|
||
|
||
|
||
def main() -> None:
|
||
s = get_settings()
|
||
init_db(s)
|
||
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()
|