egg_server/schedule/index.ts
zhaoyingbo cabc23ae77
Some checks are pending
Egg CI/CD / build-image (push) Waiting to run
Egg CI/CD / deploy (push) Blocked by required conditions
feat: 支持根据用户组转发消息
2024-03-04 12:01:14 +00:00

10 lines
284 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { resetAccessToken } from "./accessToken";
import schedule from 'node-schedule'
export const initSchedule = async () => {
// 定时任务每15分钟刷新一次token
schedule.scheduleJob('*/15 * * * *', resetAccessToken);
// 立即执行一次
resetAccessToken()
}