diff options
author | Tom Hughes <tom@compton.nu> | 2015-03-24 22:31:00 +0000 |
---|---|---|
committer | Tom Hughes <tom@compton.nu> | 2015-03-25 13:30:12 +0000 |
commit | fb885002b132b46677a4c1e4b4fbedf5a19e331c (patch) | |
tree | 6632a55e178b05375b12c1d6e2e3cb9812d6c22d /lib/chef/search | |
parent | c4ec5066313e94368d16a2c37f32973fa75c6191 (diff) | |
download | chef-fb885002b132b46677a4c1e4b4fbedf5a19e331c.tar.gz |
Ensure that a search query makes progress
If a search doesn't return a full result then increment the start
pointer by the number of rows returned, rather than assuming that
it was equal to the row limit, and defaulting to zero.
This should fix #3099
Diffstat (limited to 'lib/chef/search')
-rw-r--r-- | lib/chef/search/query.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/search/query.rb b/lib/chef/search/query.rb index 8656e810db..6469a18c49 100644 --- a/lib/chef/search/query.rb +++ b/lib/chef/search/query.rb @@ -89,7 +89,7 @@ WARNDEP if block response["rows"].each { |row| block.call(row) if row } unless (response["start"] + response["rows"].length) >= response["total"] - args_h[:start] = response["start"] + (args_h[:rows] || 0) + args_h[:start] = response["start"] + response["rows"].length search(type, query, args_h, &block) end true |