Skip to content

Commit

Permalink
Propagate refresh option properly in adminController
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrebouthinon committed Jan 25, 2022
1 parent c1197c5 commit 39576d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/api/controllers/adminController.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class AdminController extends NativeController {
force,
onExistingUsers,
user,
refresh: waitForRefresh
});

return this._waitForAction(waitForRefresh, promise);
Expand Down
2 changes: 1 addition & 1 deletion lib/core/shared/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class Repository {
*/
async _truncate (options, part = null) {
if (part === null) {
const objects = await this.search({}, { refresh: 'wait_for', scroll: '5s', size: 100 });
const objects = await this.search({}, { refresh: options.refresh, scroll: '5s', size: 100 });
const deleted = await this._truncatePart(objects, options);

if (objects.hits.length < objects.total) {
Expand Down

0 comments on commit 39576d2

Please sign in to comment.