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