11 lines
232 B
TypeScript
11 lines
232 B
TypeScript
import schedule from "node-schedule"
|
||
|
||
const func = () => {}
|
||
|
||
export const initSchedule = async () => {
|
||
// 定时任务,每15分钟刷新一次token
|
||
schedule.scheduleJob("*/15 * * * *", func)
|
||
// 立即执行一次
|
||
func()
|
||
}
|