Skip to content

Commit

Permalink
remove useless un-named function on PreFetchHooks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoandredinis committed Dec 20, 2024
1 parent b17cb1c commit b534b5b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions lib/srv/discovery/database_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ func (s *Server) startDatabaseWatchers() error {
TriggerFetchC: s.newDiscoveryConfigChangedSub(),
Origin: types.OriginCloud,
Clock: s.clock,
PreFetchHookFn: func() {
s.databaseWatcherIterationStarted()
},
PreFetchHookFn: s.databaseWatcherIterationStarted,
},
)
if err != nil {
Expand Down
4 changes: 1 addition & 3 deletions lib/srv/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,7 @@ func (s *Server) initAWSWatchers(matchers []types.AWSMatcher) error {
s.ctx, s.getAllAWSServerFetchers, s.caRotationCh,
server.WithPollInterval(s.PollInterval),
server.WithTriggerFetchC(s.newDiscoveryConfigChangedSub()),
server.WithPreFetchHookFn(func() {
s.ec2WatcherIterationStarted()
}),
server.WithPreFetchHookFn(s.ec2WatcherIterationStarted),
)
if err != nil {
return trace.Wrap(err)
Expand Down
4 changes: 1 addition & 3 deletions lib/srv/discovery/kube_integration_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ func (s *Server) startKubeIntegrationWatchers() error {
Interval: s.PollInterval,
Origin: types.OriginCloud,
TriggerFetchC: s.newDiscoveryConfigChangedSub(),
PreFetchHookFn: func() {
s.kubernetesIntegrationWatcherIterationStarted()
},
PreFetchHookFn: s.kubernetesIntegrationWatcherIterationStarted,
})
if err != nil {
return trace.Wrap(err)
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/slices/slices.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package slices

// FilterMapUnique applies a function to all elements of a slice and collects them.
// The function returns the value to collect and whether the current element should be included.
// Returned values are sorted and deduplicated.
// Returned values are deduplicated.
func FilterMapUnique[T any, S comparable](ts []T, fn func(T) (s S, include bool)) []S {
ss := make([]S, 0, len(ts))
seen := make(map[S]struct{}, len(ts))
Expand Down

0 comments on commit b534b5b

Please sign in to comment.