Skip to content

Commit 5214ded

Browse files
committed
chore(deps): update dependencies
1 parent 415ea8f commit 5214ded

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (s *StatsExporter) Collect(ch chan<- prometheus.Metric) {
7373
var invalid float64
7474

7575
// collect the memory
76-
for i := 0; i < len(workerStates); i++ {
76+
for i := range workerStates {
7777
cum += float64(workerStates[i].MemoryUsage)
7878

7979
ch <- prometheus.MustNewConstMetric(s.StateDesc, prometheus.GaugeValue, 0, workerStates[i].StatusStr, strconv.Itoa(int(workerStates[i].Pid)))

plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func (p *Plugin) Workers() []*process.State {
253253
workers := p.gPool.Workers()
254254

255255
ps := make([]*process.State, 0, len(workers))
256-
for i := 0; i < len(workers); i++ {
256+
for i := range workers {
257257
state, err := process.WorkerProcessState(workers[i])
258258
if err != nil {
259259
return nil

proxy/proxy.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212

1313
_ "google.golang.org/genproto/protobuf/ptype" //nolint:revive,nolintlint
1414

15+
"maps"
16+
1517
"github.com/roadrunner-server/errors"
1618
"github.com/roadrunner-server/goridge/v3/pkg/frame"
1719
"github.com/roadrunner-server/grpc/v5/codec"
@@ -309,9 +311,7 @@ func (p *Proxy) makePayload(ctx context.Context, method string, body *codec.RawM
309311

310312
p.prop.Inject(ctx, propagation.HeaderCarrier(ctxMD))
311313
if md, ok := metadata.FromIncomingContext(ctx); ok {
312-
for k, v := range md {
313-
ctxMD[k] = v
314-
}
314+
maps.Copy(ctxMD, md)
315315
}
316316

317317
if pr, ok := peer.FromContext(ctx); ok {

server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (p *Plugin) createGRPCserver(interceptors map[string]common.Interceptor) (*
5050
opts = append(opts, grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(p.tracer), otelgrpc.WithPropagators(p.prop))))
5151
server := grpc.NewServer(opts...)
5252

53-
for i := 0; i < len(p.config.Proto); i++ {
53+
for i := range p.config.Proto {
5454
if p.config.Proto[i] == "" {
5555
continue
5656
}

status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func (p *Plugin) Status() (*status.Status, error) {
1414

1515
workers := p.gPool.Workers()
1616

17-
for i := 0; i < len(workers); i++ {
17+
for i := range workers {
1818
if workers[i].State().IsActive() {
1919
return &status.Status{
2020
Code: http.StatusOK,
@@ -34,7 +34,7 @@ func (p *Plugin) Ready() (*status.Status, error) {
3434

3535
workers := p.gPool.Workers()
3636

37-
for i := 0; i < len(workers); i++ {
37+
for i := range workers {
3838
// If the state of the worker is ready (at least 1)
3939
// we assume that plugin's worker pool is ready
4040
if workers[i].State().Compare(fsm.StateReady) {

0 commit comments

Comments
 (0)