Fix ISSUE #27.

This commit is contained in:
Daniele Alessandri
2011-03-30 23:24:45 +02:00
parent 094a5bcc90
commit 85c1a7a852
+4 -3
View File
@@ -108,8 +108,9 @@ class MultiExecContext {
}
public function discard() {
if ($this->_initialized === true || $this->_checkAndSet) {
$this->_client->discard();
if ($this->_initialized === true) {
$command = $this->_checkAndSet ? 'unwatch' : 'discard';
$this->_client->$command();
$this->reset();
$this->_discarded = true;
}
@@ -178,7 +179,7 @@ class MultiExecContext {
if (count($this->_commands) === 0) {
if ($this->_watchedKeys) {
$this->_client->discard();
$this->discard();
return;
}
return;