Skip to content

issue 更新策略 #12

Description

@paddingme

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions