Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
castaneai committed Dec 25, 2023
1 parent 1714293 commit 166de10
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
8 changes: 0 additions & 8 deletions backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,6 @@ func (b *Backend) AddMatchFunction(profile *pb.MatchProfile, mmf MatchFunction)
func (b *Backend) Start(ctx context.Context, tickRate time.Duration) error {
ticker := time.NewTicker(tickRate)
defer ticker.Stop()

b.mmfMu.RLock()
mmfs := b.mmfs
b.mmfMu.RUnlock()
profiles := make([]string, 0, len(mmfs))
for profile := range mmfs {
profiles = append(profiles, profile.Name)
}
for {
select {
case <-ctx.Done():
Expand Down
1 change: 0 additions & 1 deletion filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func (pf *poolFilter) In(entity filteredEntity) bool {
return false
}
}
} else {
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/statestore/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ func (s *RedisStore) deIndexTickets(ticketIDs []string) []rueidis.Completed {
}
}

//nolint:unused
func (s *RedisStore) releaseTimeoutTicketsByNow(ctx context.Context) error {
return s.releaseTimeoutTickets(ctx, time.Now().Add(-s.opts.pendingReleaseTimeout))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/statestore/ticketcache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ func TestTicketCache(t *testing.T) {

time.Sleep(ttl + 10*time.Millisecond)

t1, err = store.GetTicket(ctx, "t1")
_, err = store.GetTicket(ctx, "t1")
require.Error(t, err, ErrTicketNotFound)
}
6 changes: 3 additions & 3 deletions tests/intergration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ func TestFrontend(t *testing.T) {
c := s.DialFrontend(t)
ctx := context.Background()

resp, err := c.GetTicket(ctx, &pb.GetTicketRequest{TicketId: "invalid"})
_, err := c.GetTicket(ctx, &pb.GetTicketRequest{TicketId: "invalid"})
require.Error(t, err)
requireErrorCode(t, err, codes.NotFound)

t1 := mustCreateTicket(ctx, t, c, &pb.Ticket{})

resp, err = c.GetTicket(ctx, &pb.GetTicketRequest{TicketId: t1.Id})
resp, err := c.GetTicket(ctx, &pb.GetTicketRequest{TicketId: t1.Id})
require.NoError(t, err)
require.Equal(t, resp.Id, t1.Id)

_, err = c.DeleteTicket(ctx, &pb.DeleteTicketRequest{TicketId: t1.Id})
require.NoError(t, err)

resp, err = c.GetTicket(ctx, &pb.GetTicketRequest{TicketId: t1.Id})
_, err = c.GetTicket(ctx, &pb.GetTicketRequest{TicketId: t1.Id})
requireErrorCode(t, err, codes.NotFound)
}

Expand Down

0 comments on commit 166de10

Please sign in to comment.