Clone AppConfig and ScheduledQuery list by hand to improve CPU usage (#8794)
* Close AppConfig and ScheduledQuery list by hand to improve CPU usage * Address review comments * Update remaining mocks
This commit is contained in:
@@ -429,7 +429,7 @@ type UpdateHostSoftwareFunc func(ctx context.Context, hostID uint, software []fl
|
||||
|
||||
type UpdateHostFunc func(ctx context.Context, host *fleet.Host) error
|
||||
|
||||
type ListScheduledQueriesInPackFunc func(ctx context.Context, packID uint) ([]*fleet.ScheduledQuery, error)
|
||||
type ListScheduledQueriesInPackFunc func(ctx context.Context, packID uint) (fleet.ScheduledQueryList, error)
|
||||
|
||||
type UpdateHostRefetchRequestedFunc func(ctx context.Context, hostID uint, value bool) error
|
||||
|
||||
@@ -2290,7 +2290,7 @@ func (s *DataStore) UpdateHost(ctx context.Context, host *fleet.Host) error {
|
||||
return s.UpdateHostFunc(ctx, host)
|
||||
}
|
||||
|
||||
func (s *DataStore) ListScheduledQueriesInPack(ctx context.Context, packID uint) ([]*fleet.ScheduledQuery, error) {
|
||||
func (s *DataStore) ListScheduledQueriesInPack(ctx context.Context, packID uint) (fleet.ScheduledQueryList, error) {
|
||||
s.ListScheduledQueriesInPackFuncInvoked = true
|
||||
return s.ListScheduledQueriesInPackFunc(ctx, packID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user