[#1437] node: Fix contextcheck linter

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-10-21 16:27:28 +03:00
parent 6921a89061
commit 7429553266
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0
209 changed files with 1068 additions and 1036 deletions

View file

@ -388,7 +388,7 @@ func (s *Service) syncLoop(ctx context.Context) {
break
}
newMap, cnrsToSync := s.containersToSync(cnrs)
newMap, cnrsToSync := s.containersToSync(ctx, cnrs)
s.syncContainers(ctx, cnrsToSync)
@ -475,14 +475,14 @@ func (s *Service) removeContainers(ctx context.Context, newContainers map[cid.ID
}
}
func (s *Service) containersToSync(cnrs []cid.ID) (map[cid.ID]struct{}, []cid.ID) {
func (s *Service) containersToSync(ctx context.Context, cnrs []cid.ID) (map[cid.ID]struct{}, []cid.ID) {
newMap := make(map[cid.ID]struct{}, len(s.cnrMap))
cnrsToSync := make([]cid.ID, 0, len(cnrs))
for _, cnr := range cnrs {
_, pos, err := s.getContainerNodes(cnr)
if err != nil {
s.log.Error(context.Background(), logs.TreeCouldNotCalculateContainerNodes,
s.log.Error(ctx, logs.TreeCouldNotCalculateContainerNodes,
zap.Stringer("cid", cnr),
zap.Error(err))
continue