mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 08:55:27 +03:00
Fix - default disk cache size
The default disk cache size is 100mb. Changed the default disk cache to 10gb.
This commit is contained in:
parent
db81680172
commit
9510d3e0d7
4
Makefile
4
Makefile
@ -61,10 +61,10 @@ ci-e2e: ## Runs ci e2e tests
|
||||
ci-e2e: build check-env
|
||||
$(call ndef, GITHUB_AUTH_TOKEN)
|
||||
mkdir -p bin
|
||||
./scorecard --repo=https://github.com/ossf/scorecard --format json > ./bin/results.json
|
||||
./scorecard --repo=https://github.com/ossf/scorecard --show-details --format json > ./bin/results.json
|
||||
ginkgo -p -v -cover ./...
|
||||
mkdir -p cache
|
||||
USE_DISK_CACHE=1 DISK_CACHE_PATH="./cache" ./scorecard --repo=https://github.com/ossf/scorecard --format json > ./bin/results.json
|
||||
USE_DISK_CACHE=1 DISK_CACHE_PATH="./cache" ./scorecard --repo=https://github.com/ossf/scorecard --show-details --format json > ./bin/results.json
|
||||
ginkgo -p -v -cover ./...
|
||||
|
||||
|
||||
|
1
go.mod
1
go.mod
@ -11,6 +11,7 @@ require (
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
|
||||
github.com/onsi/ginkgo v1.15.0
|
||||
github.com/onsi/gomega v1.10.5
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/shurcooL/githubv4 v0.0.0-20200928013246-d292edc3691b
|
||||
github.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
"github.com/bradleyfalzon/ghinstallation"
|
||||
cache "github.com/naveensrinivasan/httpcache"
|
||||
"github.com/naveensrinivasan/httpcache/diskcache"
|
||||
"github.com/peterbourgon/diskv"
|
||||
"github.com/pkg/errors"
|
||||
"go.uber.org/zap"
|
||||
"golang.org/x/oauth2"
|
||||
@ -89,10 +90,11 @@ func NewTransport(ctx context.Context, logger *zap.SugaredLogger) http.RoundTrip
|
||||
Logger: logger,
|
||||
InnerTransport: transport,
|
||||
}
|
||||
|
||||
const cacheSize uint64 = 10000 * 1024 * 1024 // 10gb
|
||||
// uses the disk cache
|
||||
if cachePath, useDisk := shouldUseDiskCache(); useDisk {
|
||||
c := cache.NewTransport(diskcache.New(cachePath))
|
||||
c := cache.NewTransport(diskcache.NewWithDiskv(
|
||||
diskv.New(diskv.Options{BasePath: cachePath, CacheSizeMax: cacheSize})))
|
||||
c.Transport = rateLimit
|
||||
return c
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user