forked from TrueCloudLab/frostfs-node
[#45] object/search: Fix double write of local result
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
08b9ae547a
commit
39ddb3a3f4
1 changed files with 0 additions and 6 deletions
|
@ -26,8 +26,6 @@ type searchQueryFilter struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *localStream) stream(ctx context.Context, ch chan<- []*objectSDK.ID) error {
|
func (s *localStream) stream(ctx context.Context, ch chan<- []*objectSDK.ID) error {
|
||||||
idList := make([]*objectSDK.ID, 0)
|
|
||||||
|
|
||||||
filter := &searchQueryFilter{
|
filter := &searchQueryFilter{
|
||||||
query: s.query,
|
query: s.query,
|
||||||
ch: ch,
|
ch: ch,
|
||||||
|
@ -38,16 +36,12 @@ func (s *localStream) stream(ctx context.Context, ch chan<- []*objectSDK.ID) err
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
idList = append(idList, meta.Head().GetID())
|
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}); err != nil && !errors.Is(errors.Cause(err), bucket.ErrIteratingAborted) {
|
}); err != nil && !errors.Is(errors.Cause(err), bucket.ErrIteratingAborted) {
|
||||||
return errors.Wrapf(err, "(%T) could not iterate over local storage", s)
|
return errors.Wrapf(err, "(%T) could not iterate over local storage", s)
|
||||||
}
|
}
|
||||||
|
|
||||||
ch <- idList
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue