Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
distractedm1nd committed Jul 24, 2024
1 parent 7133e90 commit c4a18ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions blob/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (s *Service) Subscribe(ctx context.Context, ns share.Namespace) (<-chan *Su
select {
case header, ok := <-headerCh:
if ctx.Err() != nil {
log.Debug("blobsub: cancelling subscription due to user context closing")
log.Debug("blobsub: canceling subscription due to user context closing")
return
}
if !ok {
Expand All @@ -141,7 +141,7 @@ func (s *Service) Subscribe(ctx context.Context, ns share.Namespace) (<-chan *Su
blobs, err := s.getAll(ctx, header, []share.Namespace{ns})
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
// context canceled, continuing would lead to unexpected missed heights for the client
log.Debug("blobsub: cancelling subscription due to user context closing")
log.Debug("blobsub: canceling subscription due to user context closing")
return
}
if err != nil {
Expand All @@ -151,15 +151,15 @@ func (s *Service) Subscribe(ctx context.Context, ns share.Namespace) (<-chan *Su

select {
case <-ctx.Done():
log.Debug("blobsub: cancelling subscription with pending response due to user context closing")
log.Debug("blobsub: canceling subscription with pending response due to user context closing")
return
case blobCh <- &SubscriptionResponse{Blobs: blobs, Height: header.Height()}:
}
case <-ctx.Done():
log.Debug("blobsub: cancelling subscription due to user context closing")
log.Debug("blobsub: canceling subscription due to user context closing")
return
case <-s.ctx.Done():
log.Debug("blobsub: cancelling subscription due to service context closing")
log.Debug("blobsub: canceling subscription due to service context closing")
return
}
}
Expand Down
5 changes: 3 additions & 2 deletions blob/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ func TestService_Subscribe(t *testing.T) {
// cancel the subscription context after receiving the first response
select {
case <-subCh:
service.Stop(context.Background())
err = service.Stop(context.Background())
require.NoError(t, err)
case <-time.After(time.Second * 2):
t.Fatal("timeout waiting for first subscription response")
}
Expand All @@ -761,7 +762,6 @@ func TestService_Subscribe(t *testing.T) {
case <-time.After(time.Second * 2):
t.Fatal("timeout waiting for subscription channel to close")
}

})
}

Expand All @@ -779,6 +779,7 @@ func TestService_Subscribe_MultipleNamespaces(t *testing.T) {
blobs2, err := convertBlobs(appBlobs2...)
require.NoError(t, err)

// nolint: gocritic

Check failure on line 782 in blob/service_test.go

View workflow job for this annotation

GitHub Actions / go-ci / Lint

directive `// nolint: gocritic` should be written without leading space as `//nolint: gocritic` (nolintlint)
allBlobs := append(blobs1, blobs2...)

service := createServiceWithSub(ctx, t, allBlobs)
Expand Down

0 comments on commit c4a18ca

Please sign in to comment.