Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue 更新策略 #12

Open
paddingme opened this issue Feb 13, 2019 · 0 comments
Open

issue 更新策略 #12

paddingme opened this issue Feb 13, 2019 · 0 comments

Comments

@paddingme
Copy link
Owner

paddingme commented Feb 13, 2019

1. 第一次 watch 这个 repo

  1. 检查这个 repo, 如果 issue 条数 超过 300条,则应该不是blog 类型仓库,需要人工审核。 若为超过300条,则并发同步该 仓库 所有的 issue 数据 到 GitIssue DB 中;

2. 当某个 issue 第一次创建时

@git-issue watch 这个 repo, 当 issue 创建时 会收到 notifications. 定时请求 notifications API( 如每10分钟一次/ 每天更新一次?), 过滤 notification.unread === true && notification.reason === 'subscribed' && notification.subject.type === 'Issue' 存入 GitIssue DB。

[ { id: '451135969',
    unread: true,
    reason: 'subscribed',
    updated_at: '2019-02-13T09:26:43Z',
    last_read_at: '2019-02-13T09:21:02Z',
    subject:
     { title: 'test22222',
       url: 'https://api.github.com/repos/paddingme/gitissue.com/issues/11',
       latest_comment_url: 'https://api.github.com/repos/paddingme/gitissue.com/issues/11',
       type: 'Issue' }
}]

3. 当某个 issue 被编辑更新了

需要定时去拉取所有 isBlogRepo = true 的 repo 的所有 issues 进行更新(比对更新时间), 若已经更新了则同步更新至 GitIssue DB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant