diff --git a/Procfile b/Procfile index 4fc86de..b85bddd 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -cachewd **/*.go !**/*_test.go !state/**/* debounce=2s ready=http:8080/_readiness=200: CACHEW_URL=http://localhost:8080 CACHEW_LOG_LEVEL=debug cachewd +cachewd cachew.hcl **/*.go !**/*_test.go !state/**/* debounce=2s ready=http:8080/_readiness=200: CACHEW_URL=http://localhost:8080 CACHEW_LOG_LEVEL=debug cachewd diff --git a/cachew.hcl b/cachew.hcl index 2c38fe8..f5dd137 100644 --- a/cachew.hcl +++ b/cachew.hcl @@ -19,13 +19,18 @@ git-clone {} metrics {} - git { #bundle-interval = "24h" snapshot-interval = "1h" repack-interval = "1h" } +host "https://ghcr.io" { + headers = { + "Authorization": "Bearer QQ==" + } +} + host "https://w3.org" {} github-releases { diff --git a/internal/strategy/git/git.go b/internal/strategy/git/git.go index b71e415..11b3cc5 100644 --- a/internal/strategy/git/git.go +++ b/internal/strategy/git/git.go @@ -7,6 +7,7 @@ import ( "crypto/sha256" "encoding/hex" "io" + "maps" "net/http" "net/http/httputil" "os" @@ -128,8 +129,6 @@ func New( if err != nil { logger.WarnContext(ctx, "Failed to get pre-fetch refs for existing repo", "upstream", repo.UpstreamURL(), "error", err) - } else { - logger.InfoContext(ctx, "Pre-fetch refs for existing repo", "upstream", repo.UpstreamURL(), "refs", preRefs) } start := time.Now() @@ -146,7 +145,8 @@ func New( logger.WarnContext(ctx, "Failed to get post-fetch refs for existing repo", "upstream", repo.UpstreamURL(), "error", err) } else { - logger.InfoContext(ctx, "Post-fetch refs for existing repo", "upstream", repo.UpstreamURL(), "refs", postRefs) + maps.DeleteFunc(postRefs, func(k, v string) bool { return preRefs[k] == v }) + logger.InfoContext(ctx, "Post-fetch changed refs for existing repo", "upstream", repo.UpstreamURL(), "refs", postRefs) } if s.config.SnapshotInterval > 0 {