feat(scheduler): 每周日05:00全量对齐job(四消息实体--full-history,修撤回/编辑+消除滞后窗口)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -524,6 +524,17 @@ class SyncScheduler:
|
||||
coalesce=True,
|
||||
max_instances=1,
|
||||
)
|
||||
# 每周全量对齐(周日 05:00):--full-history 强制翻全历史,修增量模式
|
||||
# 抓不到的撤回/编辑 + 消除 lastChatTime 滞后窗口
|
||||
sched.add_job(
|
||||
self._safe_page_run,
|
||||
CronTrigger(day_of_week="sun", hour=5, timezone=self.timezone),
|
||||
args=["full-history"],
|
||||
id="yunke_weekly_full_history",
|
||||
replace_existing=True,
|
||||
coalesce=True,
|
||||
max_instances=1,
|
||||
)
|
||||
sched.start()
|
||||
self._scheduler = sched
|
||||
logger.info(
|
||||
@@ -595,6 +606,22 @@ class SyncScheduler:
|
||||
str(self.max_conversations_per_run),
|
||||
],
|
||||
]
|
||||
elif kind == "full-history":
|
||||
# 每周全量对齐(周日 05:00):强制全量翻历史,对齐增量模式抓不到的
|
||||
# 撤回/编辑消息 + 彻底消除 lastChatTime 滞后窗口(2026-08-21)
|
||||
entities = ["messages", "group-messages", "wa-messages", "wa-group-messages"]
|
||||
commands = [
|
||||
[
|
||||
sys.executable,
|
||||
"scripts/scrape_via_page.py",
|
||||
"--entity",
|
||||
e,
|
||||
"--max-conversations",
|
||||
"99999",
|
||||
"--full-history",
|
||||
]
|
||||
for e in entities
|
||||
]
|
||||
else:
|
||||
logger.error("page sync: unknown kind %r", kind)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user