add start 手动 (menu测试
This commit is contained in:
parent
732be71a35
commit
e31b5dc739
@ -24,12 +24,13 @@ router.get("/doubanImg",async (ctx)=>{
|
|||||||
|
|
||||||
|
|
||||||
router.get("/test", async (ctx) => {
|
router.get("/test", async (ctx) => {
|
||||||
let res = await utils.uploadImg('C:/Users/11629/Desktop/80032464_p0.jpg')
|
// let res = await utils.uploadImg('C:/Users/11629/Desktop/80032464_p0.jpg')
|
||||||
ctx.body = {
|
// ctx.body = {
|
||||||
code: 0,
|
// code: 0,
|
||||||
msg: "test",
|
// msg: "test",
|
||||||
data: res
|
// data: res
|
||||||
}
|
// }
|
||||||
|
global.start = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,13 +28,15 @@ async function CheckUpdate() {
|
|||||||
let all = await getSub()
|
let all = await getSub()
|
||||||
for (let i of all) {
|
for (let i of all) {
|
||||||
let time = i.time.split(":")
|
let time = i.time.split(":")
|
||||||
if (hours == time[0] && minutes == time[1]) {
|
if (hours == time[0] && minutes == time[1] || global.start) {
|
||||||
addDown(i)
|
addDown(i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
global.start = false
|
||||||
}
|
}
|
||||||
console.log("开始定时检测更新")
|
console.log("开始定时检测更新")
|
||||||
// 设置定时器 每分钟检测更新
|
// 设置定时器 每分钟检测更新
|
||||||
|
global.start = false
|
||||||
let job = schedule.scheduleJob('0 * * * * *', () => {
|
let job = schedule.scheduleJob('0 * * * * *', () => {
|
||||||
CheckUpdate()
|
CheckUpdate()
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user