Skip to content

Scale GitHub plugin sync interval with tracked repo count - #3404

Closed
trieloff wants to merge 1 commit into
get-bb:mainfrom
trieloff:bb/slow-builtin-github-plugin-sync-thr_ns8jmyv7ee
Closed

trieloff wants to merge 1 commit into
get-bb:mainfrom
trieloff:bb/slow-builtin-github-plugin-sync-thr_ns8jmyv7ee

Conversation

@trieloff

Copy link
Copy Markdown

Human comments

What was wrong

The builtin GitHub plugin refreshed every 5 minutes with four gh list calls per tracked repository. On a machine with dozens of BB projects that is well over a thousand GraphQL invocations per hour, a large slice of the shared personal GitHub token.

What changed

  • Drop the fixed 5-minute SYNC_INTERVAL_MS.
  • Auto-scale the park from tracked repo count, targeting ~400 list calls per hour, clamped 5–60 minutes. A 34-repo catalog now parks ~21 minutes.
  • Document the scaling in README and PLUGIN_OVERVIEW.

How you verified

  • pnpm exec turbo run test --filter=bb-plugin-github — 34 passed, including new interval unit and service tests.
  • Live overlay on this machine logged next sync in 21 min (34 repo(s)).

## Human comments

## What was wrong

The builtin GitHub plugin refreshed every 5 minutes with four `gh` list
calls per tracked repository. On a machine with dozens of BB projects
that is well over a thousand GraphQL invocations per hour, a large slice
of the shared personal GitHub token.

## What changed

- Drop the fixed 5-minute `SYNC_INTERVAL_MS` (and the later 15-minute
  select setting).
- Auto-scale the park from tracked repo count, targeting ~400 list calls
  per hour, clamped 5–60 minutes. A 34-repo catalog now parks ~21 minutes.
- Document the scaling in README and PLUGIN_OVERVIEW.

## How you verified

- `pnpm exec turbo run test --filter=bb-plugin-github` — 34 passed,
  including new interval unit and service tests.
- Live overlay on this machine logged `next sync in 21 min (34 repo(s))`.

> AGENT GENERATED

Signed-off-by: Lars Trieloff <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks @trieloff for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval.

@trieloff

Copy link
Copy Markdown
Author

Filing this as an issue with a copy-pasteable repro instead of a PR (this repo needs Discord allow-list before PRs): #3406

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants