Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix:修改默认提前唤醒时间

Haowei_Du50dea4517bd4
diff --git "a/docs/\345\256\232\346\227\266\344\273\273\345\212\241.md" "b/docs/\345\256\232\346\227\266\344\273\273\345\212\241.md"
index a38a94f681..168d2fb16a 100644
--- "a/docs/\345\256\232\346\227\266\344\273\273\345\212\241.md"
+++ "b/docs/\345\256\232\346\227\266\344\273\273\345\212\241.md"
@@ -28,7 +28,7 @@
- **enabled(是否启用)**:勾选(`true`)
- **description(任务内容)**:一句自然语言,描述到点时要让 Agent 做什么,例如:
`生成一段简短的中文文本,说明当前时间点的健康打卡提醒。`
- - **wake_offset_seconds(提前秒数,可选)**:默认 300,表示提前 5 分钟唤醒 Agent 做准备。
+ - **wake_offset_seconds(提前秒数,可选)**:默认 60,表示提前 1 分钟唤醒 Agent 做准备。
![](../assets/images/定时任务1.png)
3. 保存后,任务会写入 `~/.jiuwenclaw/workspace/cron_jobs.json`,调度器自动生效。
diff --git a/jiuwenclaw/gateway/cron/controller.py b/jiuwenclaw/gateway/cron/controller.py
index 851fb56675..36f29f3469 100644
--- a/jiuwenclaw/gateway/cron/controller.py
+++ b/jiuwenclaw/gateway/cron/controller.py
@@ -302,8 +302,8 @@ class CronController:
},
"wake_offset_seconds": {
"type": "integer",
- "description": "提前多少秒执行,默认 300",
- "default": 300,
+ "description": "提前多少秒执行,默认 60",
+ "default": 60,
},
},
"required": ["name", "cron_expr", "timezone", "description"],
diff --git a/jiuwenclaw/gateway/cron/store.py b/jiuwenclaw/gateway/cron/store.py
index 664f4b4dc2..ca68fcd43f 100644
--- a/jiuwenclaw/gateway/cron/store.py
+++ b/jiuwenclaw/gateway/cron/store.py
@@ -68,7 +68,7 @@ class CronJobStore:
enabled=bool(enabled),
cron_expr=str(cron_expr or "").strip(),
timezone=str(timezone or "").strip(),
- wake_offset_seconds=int(wake_offset_seconds) if wake_offset_seconds is not None else 300,
+ wake_offset_seconds=int(wake_offset_seconds) if wake_offset_seconds is not None else 60,
description=str(description or ""),
targets=str(targets or "").strip(),
created_at=now,