Skip to content

Commit 163e491

Browse files
author
lucifer
committed
feat: daily check
1 parent 06818e6 commit 163e491

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

schedule/daily-check.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ const solutions = require("../static/solution/solutions.json");
88
const mySolutions = require("../static/my/solutions.json");
99

1010
const octokit = new Octokit({ auth: process.env.issueToken });
11-
const problem =
12-
solutions[getDay(new Date().getTime() + 24 * 60 * 60 * 1000 * 3) - 1]; // 获取昨天的题目
11+
const problem = solutions[getDay() - 1]; // 获取昨天的题目
1312

1413
if (problem && problem.issue_number) {
1514
octokit.rest.issues
@@ -24,9 +23,7 @@ if (problem && problem.issue_number) {
2423
if (!(login in mySolutions)) {
2524
mySolutions[login] = Array(91);
2625
}
27-
mySolutions[login][
28-
getDay(new Date().getTime() + 24 * 60 * 60 * 1000 * 3) - 2
29-
] = {
26+
mySolutions[login][getDay() - 2] = {
3027
title: problem.title,
3128
url: comment.html_url,
3229
body: comment.body,

0 commit comments

Comments
 (0)