From e0350efe0072d4ff12db0b4bc1b94688ce45d40b Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 3 Dec 2020 15:11:07 +0300 Subject: [PATCH] [#231] services/policer: Use engine.List method Signed-off-by: Alex Vanin --- pkg/services/policer/queue.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/pkg/services/policer/queue.go b/pkg/services/policer/queue.go index 6149d121b..88afaf7bf 100644 --- a/pkg/services/policer/queue.go +++ b/pkg/services/policer/queue.go @@ -9,15 +9,12 @@ type jobQueue struct { localStorage *engine.StorageEngine } -var jobFilter object.SearchFilters - func (q *jobQueue) Select(limit int) ([]*object.Address, error) { // TODO: optimize the logic for selecting objects // We can prioritize objects for migration, newly arrived objects, etc. // It is recommended to make changes after updating the metabase - // FIXME: add the ability to limit Select result - res, err := engine.Select(q.localStorage, getJobFilter()) + res, err := engine.List(q.localStorage, 0) // consider some limit if err != nil { return nil, err } @@ -28,12 +25,3 @@ func (q *jobQueue) Select(limit int) ([]*object.Address, error) { return res[:limit], nil } - -// getJobFilter is a getter for a singleton instance. -func getJobFilter() object.SearchFilters { - if len(jobFilter) == 0 { - jobFilter.AddPhyFilter() // this initiates a list of filters - } - - return jobFilter -}