diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-11-17 11:30:43 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-11-18 14:44:03 +0300 |
commit | 0c9a7cf01773912fdb46318ff701329d8e88a7ba (patch) | |
tree | 2b345bdf2bef2e896dc02eab67210339f4ea7ed4 /internal/praefect/service/server | |
parent | ceb74a98a167684aebff86f23a7d8ac6ffc8c91c (diff) |
nodes: Add context parameter to `GetShard()`
The `nodes.Manager` interface's method `GetShard()` doesn't currently
receive a context as parameter, even though some of its implementations
perform non-trivial and potentially blocking work like querying the
database. This commit thus adds this parameter and adjusts all current
callsites.
Diffstat (limited to 'internal/praefect/service/server')
-rw-r--r-- | internal/praefect/service/server/disk_stats.go | 2 | ||||
-rw-r--r-- | internal/praefect/service/server/info.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/praefect/service/server/disk_stats.go b/internal/praefect/service/server/disk_stats.go index 607bf334f..8189fd0a7 100644 --- a/internal/praefect/service/server/disk_stats.go +++ b/internal/praefect/service/server/disk_stats.go @@ -13,7 +13,7 @@ func (s *Server) DiskStatistics(ctx context.Context, _ *gitalypb.DiskStatisticsR var storageStatuses [][]*gitalypb.DiskStatisticsResponse_StorageStatus for _, virtualStorage := range s.conf.VirtualStorages { - shard, err := s.nodeMgr.GetShard(virtualStorage.Name) + shard, err := s.nodeMgr.GetShard(ctx, virtualStorage.Name) if err != nil { return nil, err } diff --git a/internal/praefect/service/server/info.go b/internal/praefect/service/server/info.go index 30c17374e..3c9b8dd06 100644 --- a/internal/praefect/service/server/info.go +++ b/internal/praefect/service/server/info.go @@ -20,7 +20,7 @@ func (s *Server) ServerInfo(ctx context.Context, in *gitalypb.ServerInfoRequest) storageStatuses := make([]*gitalypb.ServerInfoResponse_StorageStatus, len(s.conf.VirtualStorages)) for i, virtualStorage := range s.conf.VirtualStorages { - shard, err := s.nodeMgr.GetShard(virtualStorage.Name) + shard, err := s.nodeMgr.GetShard(ctx, virtualStorage.Name) if err != nil { ctxlogrus.Extract(ctx).WithField("virtual_storage", virtualStorage.Name).WithError(err).Error("error when getting shard") continue |