合并
This commit is contained in:
@@ -40,6 +40,34 @@ def parse_args():
|
||||
parser.add_argument("--api-timeout", type=int, help="API超时(秒)")
|
||||
parser.add_argument("--api-page-size", type=int, help="分页大小")
|
||||
parser.add_argument("--api-retry-max", type=int, help="API重试最大次数")
|
||||
|
||||
# 回溯/手动窗口
|
||||
parser.add_argument(
|
||||
"--window-start",
|
||||
dest="window_start",
|
||||
help="固定时间窗口开始(优先级高于游标,例如:2025-07-01 00:00:00)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--window-end",
|
||||
dest="window_end",
|
||||
help="固定时间窗口结束(优先级高于游标,推荐用月末+1,例如:2025-08-01 00:00:00)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--force-window-override",
|
||||
action="store_true",
|
||||
help="强制使用 window_start/window_end,不走 MAX(fetched_at) 兜底",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--window-split-unit",
|
||||
dest="window_split_unit",
|
||||
help="窗口切分单位(month/none),默认来自配置 run.window_split.unit",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--window-compensation-hours",
|
||||
dest="window_compensation_hours",
|
||||
type=int,
|
||||
help="窗口前后补偿小时数,默认来自配置 run.window_split.compensation_hours",
|
||||
)
|
||||
|
||||
# 目录参数
|
||||
parser.add_argument("--export-root", help="导出根目录")
|
||||
@@ -108,6 +136,22 @@ def build_cli_overrides(args) -> dict:
|
||||
if args.write_pretty_json:
|
||||
overrides.setdefault("io", {})["write_pretty_json"] = True
|
||||
|
||||
# 回溯/手动窗口
|
||||
if args.window_start or args.window_end:
|
||||
overrides.setdefault("run", {}).setdefault("window_override", {})
|
||||
if args.window_start:
|
||||
overrides["run"]["window_override"]["start"] = args.window_start
|
||||
if args.window_end:
|
||||
overrides["run"]["window_override"]["end"] = args.window_end
|
||||
if args.force_window_override:
|
||||
overrides.setdefault("run", {})["force_window_override"] = True
|
||||
if args.window_split_unit:
|
||||
overrides.setdefault("run", {}).setdefault("window_split", {})["unit"] = args.window_split_unit
|
||||
if args.window_compensation_hours is not None:
|
||||
overrides.setdefault("run", {}).setdefault("window_split", {})[
|
||||
"compensation_hours"
|
||||
] = args.window_compensation_hours
|
||||
|
||||
# 运行窗口
|
||||
if args.idle_start:
|
||||
overrides.setdefault("run", {}).setdefault("idle_window", {})["start"] = args.idle_start
|
||||
|
||||
Reference in New Issue
Block a user