Skip to content

Commit 33e6603

Browse files
author
robot
committed
lastFulllyUpdateTime
1 parent 4d45882 commit 33e6603

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

schedule/daily-check.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ async function run(d, issue_number) {
7373
}
7474

7575
// 仅更新当天的
76-
const lastUpdateTime = meta.dailyCheck ? meta.dailyCheck.lastUpdateTime : -1;
77-
if ((TODAY - getDay(lastUpdateTime)) < 1) {
76+
const lastFulllyUpdateTime = meta.dailyCheck ? meta.dailyCheck.lastFulllyUpdateTime : -1;
77+
if ((TODAY - getDay(lastFulllyUpdateTime)) < 1) {
7878
run(TODAY);
7979
} else {
8080
// 更新历史所有的,每天仅全量更新一次
@@ -85,6 +85,12 @@ if ((TODAY - getDay(lastUpdateTime)) < 1) {
8585
for (let d = 1; d <= TODAY; d++) {
8686
run(d);
8787
}
88+
meta.dailyCheck.lastFulllyUpdateTime = new Date().getTime();
89+
90+
fs.writeFileSync(
91+
path.resolve(__dirname, "../static/meta.json"),
92+
JSON.stringify(meta),
93+
);
8894
}
8995

9096
module.exports = { run };

static/meta.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
{"users":{"lastUpdateTime":1652446698573},"dailyCheck":{"lastUpdateTime":1652445159082},"checkIn":{"lastUpdateTime":1652445159222},"lectures":{"lastUpdateTime":1652077961032},"preCard":true}
1+
{
2+
"users": {
3+
"lastUpdateTime": 1652446698573
4+
},
5+
"dailyCheck": {
6+
"lastUpdateTime": 1652445159082,
7+
"lastFulllyUpdateTime": -1
8+
},
9+
"checkIn": {
10+
"lastUpdateTime": 1652445159222
11+
},
12+
"lectures": {
13+
"lastUpdateTime": 1652077961032
14+
},
15+
"preCard": true
16+
}

0 commit comments

Comments
 (0)