import{_ as i,c as a,a0 as n,o as t}from"./chunks/framework.p2VkXzrt.js";const d=JSON.parse('{"title":"定时任务配置格式","description":"","frontmatter":{"title":"定时任务配置格式"},"headers":[],"relativePath":"issues/182.md","filePath":"issues/182.md","lastUpdated":null}'),l={name:"issues/182.md"};function h(p,s,k,e,E,r){return t(),a("div",null,s[0]||(s[0]=[n(`

定时任务配置格式

支持采用 crontab 的格式配置定时任务,已经支持下面的任务类型:

示例

json
[
    {
        "expression": "0 8 * * 0-4",
        "name": "play",
        "did": "123456789",
        "arg1": "周杰伦晴天"
    },
    {
        "expression": "10 8 * * 0-4",
        "name": "stop",
        "did": "123456789"
    },
    {
        "expression": "0 9 * * *",
        "name": "play",
        "did": "123456789",
        "arg1": "周杰伦晴天"
    },
    {
        "expression": "0 10 * * *",
        "name": "play_music_list",
        "did": "123456789",
        "arg1": "周杰伦"
    },
    {
        "expression": "30 10 * * *",
        "name": "play_music_list",
        "did": "123456789",
        "arg1": "周杰伦|晴天"
    },
    {
        "expression": "0 7 * * *",
        "name": "tts",
        "did": "123456789",
        "arg1": "早上好!该起床了!"
    },
    {
        "expression": "0 3 * * *",
        "name": "refresh_music_list"
    },
    {
        "expression": "* * * * *",
        "name": "set_volume",
        "did": "123456789",
        "arg1": "25"
    },
    {
        "expression": "* * * * *",
        "name": "set_play_type",
        "did": "123456789",
        "arg1": "2"
    }
]

示例中的意思是:

注意星期一是0,星期二是1,星期日是6。 (0-6 or mon,tue,wed,thu,fri,sat,sun) The first weekday is always monday.

参数意思

评论

评论 1 - hanxi

0.3.38版本功能。


链接到 GitHub Issue

`,15)]))}const u=i(l,[["render",h]]);export{d as __pageData,u as default};