egg_server/schedule/index.ts
zhaoyingbo 490c6ea3e5
All checks were successful
Egg CI/CD / build-image (push) Successful in 29s
Egg CI/CD / deploy (push) Successful in 21s
feat: 优化app数据的存储方式
2024-07-10 11:26:56 +00:00

10 lines
296 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();
};