Skip to content

Commit 7a6f86c

Browse files
committed
perf and priority tweaks
1 parent f2fa895 commit 7a6f86c

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

src/bkg.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ main() {
127127

128128
echo "$(
129129
echo "0/$GITHUB_OWNER"
130-
cat "$connections"
130+
sort <"$connections" | uniq -c | sort -nr | awk '{print $2}'
131131
cat "$BKG_OWNERS"
132132
)" >"$BKG_OWNERS"
133133

src/lib/util.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ check_limit() {
147147
local minute_calls
148148
local sec_limit_diff
149149
local min_passed
150-
local max_len=${1:-18000}
150+
local max_len=${1:-14400}
151151
local rate_limit_start
152152
rate_limit_end=$(date -u +%s)
153153
[ -n "$BKG_SCRIPT_START" ] && rate_limit_start="$BKG_SCRIPT_START" || {

src/templates/.README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212

1313
</div>
1414

15-
Wish you could show npm, gem, mvn, Gradle, NuGet, or GHCR badges? Or just query for the download counts? Tough luck; the GitHub Packages API has never exposed publicly-available metadata that other registries provide. This is the solution.
15+
Wish you could show npm, gem, mvn, Gradle, NuGet, or GHCR badges? Or just query for the download counts? This endpoint makes that possible, using only free GitHub resources; the GitHub Packages API doesn't, and has never, exposed the publicly-available metadata that other registries provide.
1616

1717
## The Endpoint
1818

1919
```py
2020
https://ipitio.github.io/backage/OWNER/[REPO/[PACKAGE]].FORMAT
2121
```
2222

23-
If this is [`ipitio/backage`](https://github.com/ipitio/backage), all you have to do is star the repo to have GitHub generate this additional endpoint for your public packages! Otherwise, you can add yourself as described [below](#manual-actions).
23+
If this is [`ipitio/backage`](https://github.com/ipitio/backage), all you have to do is **star the repo to have GitHub generate this additional endpoint for your public packages!** A service ran by GitHub will add them to its circular priority queue within the next few hours and update the [closed-loop system](https://github.com/<GITHUB_OWNER>/<GITHUB_REPO>/releases/latest). Additionally watching and forking the repo, and following the owner, are ways to increase your priority. Yes, I know, but these are the signals that can be automatically processed. Otherwise, if this is a fork or you'd prefer an alternative method, see [below](#manual-actions).
2424

25-
A service ran by GitHub will add them to its circular priority queue within the next few hours and update the [closed-loop system](https://github.com/<GITHUB_OWNER>/<GITHUB_REPO>/releases/latest). Once it does so, replace the parameters with their respective values, scoping to your parsing needs, then access the latest data however you want. Use something like [shields.io/json](https://shields.io/badges/dynamic-json-badge) or [shields.io/xml](https://shields.io/badges/dynamic-xml-badge) to make badges like the ones above or the one [here](https://github.com/badges/shields/issues/5594#issuecomment-2157626147).
25+
Once added, replace the parameters above with their respective values, scoping to your parsing needs, then access the latest data however you want. Use something like [shields.io/json](https://shields.io/badges/dynamic-json-badge) or [shields.io/xml](https://shields.io/badges/dynamic-xml-badge) to make badges like the ones you just scrolled past or the one [here](https://github.com/badges/shields/issues/5594#issuecomment-2157626147).
2626

2727
> [!NOTE]
2828
> The format can be either `json` or `xml`. You'll need the XML endpoint to evaluate expressions, like filters, with Shields -- see [this issue](https://github.com/ipitio/backage/issues/23).

src/test/update.sh

+9
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,19 @@ root="${1:-.}"
1010
pushd "$root"/src || exit 1
1111
source bkg.sh
1212
popd || exit 1
13+
14+
# permissions
1315
git config --global user.name "${GITHUB_ACTOR}"
1416
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
1517
git config --global --add safe.directory "$(pwd)"
1618
git config core.sharedRepository all
19+
20+
# performance
21+
git config core.fsmonitor true
22+
git config core.untrackedcache true
23+
git config feature.manyFiles true
24+
git update-index --index-version 4
25+
1726
sudonot chmod -R a+rwX .
1827
sudonot find . -type d -exec chmod g+s '{}' +
1928

0 commit comments

Comments
 (0)