You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add support for conditional requests via local cache (#17368)
<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->
#### Summary
Implements
https://github.com/google/go-github?tab=readme-ov-file#conditional-requests
Tested it and indeed saw some requests returned from the cache and not
counting towards the limit
<!--
Use the following steps to ensure your PR is ready to be reviewed
- [ ] Read the [contribution
guidelines](https://github.com/cloudquery/cloudquery/blob/main/CONTRIBUTING.md)
🧑🎓
- [ ] Run `make lint` to ensure the proposed changes follow the coding
style 🚨 (install golangci-lint
[here](https://golangci-lint.run/usage/install/#local-installation))
- [ ] Run `make test` to ensure the proposed changes pass the tests 🧪
- [ ] If changing a source plugin run `make gen` to ensure docs are up
to date 📝
- [ ] Ensure the status checks below are successful ✅
--->
// Path to a local directory that will hold the cache. If set, the plugin will cache the GitHub API responses in this directory. Defaults to an empty string (no cache)
Copy file name to clipboardExpand all lines: plugins/source/github/docs/_configuration.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ spec:
38
38
# concurrency: 1500 # Optional. The best effort maximum number of Go routines to use. Lower this number to reduce memory usage or to avoid hitting GitHub API rate limits. Default 1500.
39
39
# discovery_concurrency: 1 # Optional. Number of concurrent requests to GitHub API during discovery phase. Default 1.
40
40
# include_archived_repos: false # Optional. Include archived repositories in the sync. Default false.
41
+
# local_cache_path: "" # Optional. Path to a local directory that will hold the cache. If set, the plugin will cache the GitHub API responses in this directory. Defaults to an empty string (no cache).
41
42
```
42
43
43
44
See [tables](/docs/plugins/sources/github/tables) for a full list of available tables.
Path to a local directory that will hold the cache. If set, the plugin will cache the GitHub API responses in this directory. Defaults to an empty string (no cache).
47
+
By using a cache, the plugin can use [conditional requests when appropriate](https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?#use-conditional-requests-if-appropriate), and help avoid hitting GitHub API rate limits.
0 commit comments