Skip to content

Commit bce463f

Browse files
author
robot
committed
feat: 更新用户信息
1 parent 9694a95 commit bce463f

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

static/meta.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
{"dailyCheck":{"lastUpdateTime":1621840918674}}
1+
{
2+
"dailyCheck": { "lastUpdateTime": 1621840918674 },
3+
"users": {
4+
"lastUpdateTime": -1
5+
}
6+
}

static/users/generate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const fs = require("fs");
22
const { Octokit } = require("@octokit/rest");
33
const { db } = require("../../config/index");
44
const users = require("./index.json");
5+
const { getDay } = require("../../utils/day");
6+
const meta = require("../meta.json");
57

68
async function run(incremental = true) {
79
const octokit = new Octokit({ auth: process.env.issueToken });
@@ -36,7 +38,7 @@ async function run(incremental = true) {
3638
let incremental = true;
3739

3840
// 七天全量更新一次
39-
if (getDay(TODAY) - getDay(meta.dailyCheck.lastUpdateTime) >= 7) {
41+
if (getDay() - getDay(meta.users.lastUpdateTime) >= 7) {
4042
incremental = false;
4143
}
4244
run(incremental).then(() =>

static/users/index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)