add start 手动 (menu测试

This commit is contained in:
theluyuan 2023-07-31 22:24:56 +08:00
parent 732be71a35
commit e31b5dc739
2 changed files with 10 additions and 7 deletions

View File

@ -24,12 +24,13 @@ router.get("/doubanImg",async (ctx)=>{
router.get("/test", async (ctx) => {
let res = await utils.uploadImg('C:/Users/11629/Desktop/80032464_p0.jpg')
ctx.body = {
code: 0,
msg: "test",
data: res
}
// let res = await utils.uploadImg('C:/Users/11629/Desktop/80032464_p0.jpg')
// ctx.body = {
// code: 0,
// msg: "test",
// data: res
// }
global.start = true
})

View File

@ -28,13 +28,15 @@ async function CheckUpdate() {
let all = await getSub()
for (let i of all) {
let time = i.time.split(":")
if (hours == time[0] && minutes == time[1]) {
if (hours == time[0] && minutes == time[1] || global.start) {
addDown(i)
}
}
global.start = false
}
console.log("开始定时检测更新")
// 设置定时器 每分钟检测更新
global.start = false
let job = schedule.scheduleJob('0 * * * * *', () => {
CheckUpdate()
});