Fix some of the linter exceptions #156

Merged
fyrchik merged 7 commits from fyrchik/frostfs-node:linter-fixes into master 2023-03-22 07:14:19 +00:00
Showing only changes of commit 3cebbaf621 - Show all commits

View file

@ -52,7 +52,7 @@ func (s *Service) localReplicationWorker() {
}
}
func (s *Service) replicationWorker() {
func (s *Service) replicationWorker(ctx context.Context) {
for {
select {
case <-s.closeCh:
@ -64,13 +64,13 @@ func (s *Service) replicationWorker() {
task.n.IterateNetworkEndpoints(func(addr string) bool {
lastAddr = addr
c, err := s.cache.get(context.Background(), addr)
c, err := s.cache.get(ctx, addr)
if err != nil {
lastErr = fmt.Errorf("can't create client: %w", err)
return false
}
ctx, cancel := context.WithTimeout(context.Background(), s.replicatorTimeout)
ctx, cancel := context.WithTimeout(ctx, s.replicatorTimeout)
_, lastErr = c.Apply(ctx, task.req)
cancel()
@ -94,8 +94,7 @@ func (s *Service) replicationWorker() {
func (s *Service) replicateLoop(ctx context.Context) {
for i := 0; i < s.replicatorWorkerCount; i++ {
//nolint: contextcheck
go s.replicationWorker()
go s.replicationWorker(ctx)
go s.localReplicationWorker()
}
defer func() {