perf: Use circuit breaker to fail open Malysis query requests (#196)

* perf: Use circuit breaker to fail open Malysis query requests

* fix: Linter fixes

* test: Add test to confirm grpc status error unwrapping
This commit is contained in:
Abhisek Datta
2026-04-03 21:39:00 +05:30
committed by GitHub
parent c7c4fc462f
commit 115531f6b3
6 changed files with 262 additions and 5 deletions
+2 -1
View File
@@ -52,6 +52,7 @@ func NewNpmRegistryInterceptor(
cache: cache,
statsCollector: statsCollector,
confirmationChan: confirmationChan,
circuitBreaker: newAnalyzerCircuitBreaker("malysis-analyzer-npm"),
},
}
}
@@ -110,7 +111,7 @@ func (i *NpmRegistryInterceptor) HandleRequest(ctx *proxy.RequestContext) (*prox
return &proxy.InterceptorResponse{Action: proxy.ActionAllow}, nil
}
result, err := i.baseRegistryInterceptor.analyzePackage(
result, err := i.analyzePackage(
ctx,
packagev1.Ecosystem_ECOSYSTEM_NPM,
pkgInfo.GetName(),