Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clear scroll: pass scroll_id in body #796

Merged
merged 1 commit into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@

## master (unreleased)

### New Features

### Changes

### Bugs Fixed

## 7.2.1 (2021-05-11)

### New Features

* [#469](https://github.com/toptal/chewy/issues/469): Add ability to output the progressbar with `ENV['PROGRESS']` during `reset` rake tasks ([@Vitalina-Vakulchyk][]):
* for `rake chewy:reset` and `rake chewy:parallel:reset`
* progressbar is hidden by default, set `ENV['PROGRESS']` to `true` to display it

### Changes

### Bugs Fixed

* [#796](https://github.com/toptal/chewy/pull/796): Fix clear scroll: pass `scroll_id` in body, as passing in path parameters is deprecated and can overflow `http.max_initial_line_length` ([@rabotyaga][])

## 7.0.1 (2021-05-03)

### Changes
Expand Down
2 changes: 1 addition & 1 deletion lib/chewy/search/scrolling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def scroll_batches(batch_size: Request::DEFAULT_BATCH_SIZE, scroll: Request::DEF
result = perform_scroll(scroll: scroll, scroll_id: scroll_id)
end
ensure
Chewy.client.clear_scroll(scroll_id: scroll_id) if scroll_id
Chewy.client.clear_scroll(body: {scroll_id: scroll_id}) if scroll_id
end

# @!method scroll_hits(batch_size: 1000, scroll: '1m')
Expand Down
2 changes: 1 addition & 1 deletion lib/chewy/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Chewy
VERSION = '7.2.0'.freeze
VERSION = '7.2.1'.freeze
end
2 changes: 1 addition & 1 deletion spec/chewy/search/scrolling_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
end

it 'clears the scroll after completion' do
expect(Chewy.client).to receive(:clear_scroll).with(scroll_id: anything).once.and_call_original
expect(Chewy.client).to receive(:clear_scroll).with(body: {scroll_id: anything}).once.and_call_original
request.scroll_batches(batch_size: 3) {}
end

Expand Down