diff --git a/webui/src/components/monitor/TaskEditorDialog.tsx b/webui/src/components/monitor/TaskEditorDialog.tsx index 388360f..2718b12 100644 --- a/webui/src/components/monitor/TaskEditorDialog.tsx +++ b/webui/src/components/monitor/TaskEditorDialog.tsx @@ -57,6 +57,15 @@ const SCHEDULE_MODE_OPTIONS: Array<{ value: ScheduleMode; label: string }> = [ ] const HOURS = Array.from({ length: 24 }, (_, hour) => hour) + +/** + * Above this many works per run, warn about the request volume. + * + * The runner serialises crawls (max_concurrency_num=1) and each note also pulls + * up to `max_comments_count` comments, so the cost is works × (1 + comments) and + * the default run timeout is an hour. + */ +const NOTE_VOLUME_WARN = 500 const MINUTES = Array.from({ length: 60 }, (_, minute) => minute) const WEEKDAYS = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] const pad = (value: number) => String(value).padStart(2, '0') @@ -371,18 +380,48 @@ export function TaskEditorDialog({ open, onOpenChange, task }: TaskEditorDialogP
setMaxNotes(event.target.value)} + disabled={mode === 'note'} className="h-9 text-xs" /> -

- 只取最新的前 N 条,决定了"该博主的作品"覆盖范围 -

+ + {mode === 'creator' ? ( + <> + {/* 这是「每个博主」的上限,不是一轮的总量 —— 爬虫里这个值是在 + per-creator 的函数内比较的(client.py get_all_notes_by_creator), + 而外层 for 循环会遍历全部目标。所以 100 个目标 × 20 篇 = 单轮 + 最多 2000 篇。标签写成「每轮最多」会让人以为超出的会被丢弃。 */} +

+ 这是每个博主的上限, + 不是一轮的总量。只取该博主最新的前 N 条,超出的不会补抓。 +

+

+ {targetList.length} 个目标 × {maxNotes} 篇 × 每人 1 次 + → 单轮最多{' '} + + {targetList.length * (Number(maxNotes) || 0)} + {' '} + 篇 +

+ {targetList.length * (Number(maxNotes) || 0) > NOTE_VOLUME_WARN && ( +

+ 单轮量偏大:每篇还要抓最多 {maxComments} 条评论,且并发为 1。 + 容易触发平台限流,也可能跑不完就被任务超时(默认 1 小时)中断。 + 建议调低这个数,或拆成几个任务。 +

+ )} + + ) : ( +

+ 笔记模式下此项不生效:你列出的每个链接都会被逐条抓取。 +

+ )}