@@ -421,8 +421,8 @@ def disable_reconnection(&block)
421
421
ensure_connected ( retryable : false , &block )
422
422
end
423
423
424
- def pipelined
425
- pipeline = Pipeline . new ( @command_builder )
424
+ def pipelined ( raise_exception : true )
425
+ pipeline = Pipeline . new ( @command_builder , raise_exception : raise_exception )
426
426
yield pipeline
427
427
428
428
if pipeline . _size == 0
@@ -431,7 +431,7 @@ def pipelined
431
431
results = ensure_connected ( retryable : pipeline . _retryable? ) do |connection |
432
432
commands = pipeline . _commands
433
433
@middlewares . call_pipelined ( commands , config ) do
434
- connection . call_pipelined ( commands , pipeline . _timeouts )
434
+ connection . call_pipelined ( commands , pipeline . _timeouts , pipeline . _raise_exception )
435
435
end
436
436
end
437
437
@@ -579,6 +579,10 @@ def _timeouts
579
579
nil
580
580
end
581
581
582
+ def _raise_exception
583
+ true
584
+ end
585
+
582
586
def _retryable?
583
587
@retryable
584
588
end
@@ -600,9 +604,10 @@ def _coerce!(results)
600
604
end
601
605
602
606
class Pipeline < Multi
603
- def initialize ( _command_builder )
604
- super
607
+ def initialize ( _command_builder , raise_exception : true )
608
+ super ( _command_builder )
605
609
@timeouts = nil
610
+ @raise_exception = raise_exception
606
611
end
607
612
608
613
def blocking_call ( timeout , *command , **kwargs , &block )
@@ -627,6 +632,10 @@ def _timeouts
627
632
@timeouts
628
633
end
629
634
635
+ def _raise_exception
636
+ @raise_exception
637
+ end
638
+
630
639
def _empty?
631
640
@commands . empty?
632
641
end
0 commit comments