Skip to content

Commit

Permalink
test: throw in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Oct 9, 2024
1 parent f4f35d8 commit 53dc9fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/operations/client_bulk_write/command_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ export class ClientBulkWriteCommandBuilder {

// Multi updates are not retryable.
if (model.name === 'deleteMany' || model.name === 'updateMany') {
console.log('Batch is not retryable');
this.isBatchRetryable = false;
}

Expand Down
1 change: 0 additions & 1 deletion src/operations/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export abstract class CommandOperation<T> extends AbstractOperation<T> {
cmd = decorateWithExplain(cmd, this.explain);
}

console.log(options);
return await server.command(this.ns, cmd, options, responseType);
}
}
4 changes: 4 additions & 0 deletions src/operations/execute_operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ async function tryOperation<
});
}

if (operation.hasAspect(Aspect.COMMAND_BATCHING) && !operation.canRetryWrite) {
throw previousOperationError;
}

if (hasWriteAspect && !isRetryableWriteError(previousOperationError))
throw previousOperationError;

Expand Down

0 comments on commit 53dc9fc

Please sign in to comment.