mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
💥 remove built-in scheduler support
This commit is contained in:
@ -130,9 +130,7 @@ module.exports = context => ({
|
||||
title: "发布",
|
||||
collapsable: false,
|
||||
sidebar: "auto",
|
||||
children: [
|
||||
"publish-plugin"
|
||||
]
|
||||
children: ["publish-plugin"]
|
||||
}
|
||||
],
|
||||
"/api/": [
|
||||
@ -169,10 +167,6 @@ module.exports = context => ({
|
||||
title: "nonebot.permission 模块",
|
||||
path: "permission"
|
||||
},
|
||||
{
|
||||
title: "nonebot.sched 模块",
|
||||
path: "sched"
|
||||
},
|
||||
{
|
||||
title: "nonebot.log 模块",
|
||||
path: "log"
|
||||
|
@ -25,9 +25,6 @@
|
||||
* [nonebot.permission](permission.html)
|
||||
|
||||
|
||||
* [nonebot.sched](sched.html)
|
||||
|
||||
|
||||
* [nonebot.log](log.html)
|
||||
|
||||
|
||||
|
@ -283,17 +283,3 @@ SESSION_EXPIRE_TIMEOUT=120 # 单位: 秒
|
||||
SESSION_EXPIRE_TIMEOUT=[DD ][HH:MM]SS[.ffffff]
|
||||
SESSION_EXPIRE_TIMEOUT=P[DD]DT[HH]H[MM]M[SS]S # ISO 8601
|
||||
```
|
||||
|
||||
|
||||
### `apscheduler_config`
|
||||
|
||||
|
||||
* **类型**: `dict`
|
||||
|
||||
|
||||
* **默认值**: `{"apscheduler.timezone": "Asia/Shanghai"}`
|
||||
|
||||
|
||||
* **说明**
|
||||
|
||||
APScheduler 的配置对象,见 [Configuring the Scheduler](https://apscheduler.readthedocs.io/en/latest/userguide.html#configuring-the-scheduler)
|
||||
|
@ -1,41 +0,0 @@
|
||||
---
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
|
||||
# NoneBot.sched 模块
|
||||
|
||||
## 计划任务
|
||||
|
||||
计划任务使用第三方库 [APScheduler](https://github.com/agronholm/apscheduler) ,使用文档请参考 [APScheduler使用文档](https://apscheduler.readthedocs.io/en/latest/) 。
|
||||
|
||||
|
||||
## `scheduler`
|
||||
|
||||
|
||||
* **类型**
|
||||
|
||||
`Optional[apscheduler.schedulers.asyncio.AsyncIOScheduler]`
|
||||
|
||||
|
||||
|
||||
* **说明**
|
||||
|
||||
当可选依赖 `APScheduler` 未安装时,`scheduler` 为 None
|
||||
|
||||
使用 `pip install nonebot[scheduler]` 安装可选依赖
|
||||
|
||||
|
||||
|
||||
* **常用示例**
|
||||
|
||||
|
||||
```python
|
||||
from nonebot import scheduler
|
||||
|
||||
@scheduler.scheduled_job("cron", hour="*/2", id="xxx", args=[1], kwargs={arg2: 2})
|
||||
async def run_every_2_hour(arg1, arg2):
|
||||
pass
|
||||
|
||||
scheduler.add_job(run_every_day_from_program_start, "interval", days=1, id="xxx")
|
||||
```
|
Reference in New Issue
Block a user