Skip to content

Commit

Permalink
feat: update FULLSYNC_LIMIT and PARTIALSYNC_LIMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
imfycc committed Nov 1, 2021
1 parent 4d257b7 commit 593e7e5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/full-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
NOTION_DATABASE_ID: ${{ secrets.NOTION_DATABASE_ID }}
TOKEN_OF_GITHUB: ${{ secrets.TOKEN_OF_GITHUB }}
FULLSYNC_LIMIT: 20
PARTIALSYNC_LIMIT: 10
FULLSYNC_LIMIT: ${{ secrets.FULLSYNC_LIMIT }}
PARTIALSYNC_LIMIT: ${{ secrets.PARTIALSYNC_LIMIT }}
FULL_SYNC: true
run: npm start
4 changes: 2 additions & 2 deletions .github/workflows/partial-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
NOTION_DATABASE_ID: ${{ secrets.NOTION_DATABASE_ID }}
TOKEN_OF_GITHUB: ${{ secrets.TOKEN_OF_GITHUB }}
FULLSYNC_LIMIT: 2000
PARTIALSYNC_LIMIT: 10
FULLSYNC_LIMIT: ${{ secrets.FULLSYNC_LIMIT }}
PARTIALSYNC_LIMIT: ${{ secrets.PARTIALSYNC_LIMIT }}
run: npm start

- uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion libs/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Github {
const limit = +process.env.PARTIALSYNC_LIMIT || 10;
console.log(`Github: Start to sync latest starred repos, limit is ${limit}`);

const data = await this.getLastStarredRepo(10);
const data = await this.getLastStarredRepo(limit);
this.repoList.push(
...(data.starredRepositories.edges || []).map(({ node, starredAt }) => ({
...node,
Expand Down
2 changes: 1 addition & 1 deletion readme.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
除此之外,还可以修改环境变量的形式修改当前的配置,例如:

- `FULLSYNC_LIMIT` 全量同步的最大 Repo 个数,默认为 2000 个
- `PARTIALSYNC_LIMIT` 增量同步的最大 Repo 个数,每次增量同步会从后往前取若干条数据,默认为 20
- `PARTIALSYNC_LIMIT` 增量同步的最大 Repo 个数,每次增量同步会从后往前取若干条数据,默认为 10

需要在 `github/workflows/*.yml` 中,修改这个配置

Expand Down

0 comments on commit 593e7e5

Please sign in to comment.