mirror of
https://github.com/predis/predis.git
synced 2026-09-14 20:37:29 +00:00
Fix a couple of corner cases for Predis\MultiExecContext.
This commit is contained in:
@@ -105,9 +105,11 @@ class MultiExecContext {
|
||||
}
|
||||
|
||||
public function discard() {
|
||||
$this->_client->discard();
|
||||
$this->reset();
|
||||
$this->_discarded = true;
|
||||
if ($this->_initialized) {
|
||||
$this->_client->discard();
|
||||
$this->reset();
|
||||
$this->_discarded = true;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -128,6 +130,7 @@ class MultiExecContext {
|
||||
);
|
||||
}
|
||||
if (count($this->_commands) > 0) {
|
||||
$this->discard();
|
||||
throw new ClientException(
|
||||
'Cannot execute a transaction block after using fluent interface'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user