Преглед на файлове

Fix and optimize WATCH with CAS.

Daniele Alessandri преди 14 години
родител
ревизия
46b56437a4
променени са 1 файла, в които са добавени 2 реда и са изтрити 13 реда
  1. 2 13
      lib/Predis.php

+ 2 - 13
lib/Predis.php

@@ -850,21 +850,10 @@ class MultiExecBlock {
 
     public function watch($keys) {
         $this->isWatchSupported();
-        if ($this->_initialized === true) {
+        if ($this->_initialized && !$this->_checkAndSet) {
             throw new ClientException('WATCH inside MULTI is not allowed');
         }
-
-        $reply = null;
-        if (is_array($keys)) {
-            $reply = array();
-            foreach ($keys as $key) {
-                $reply = $this->_redisClient->watch($keys);
-            }
-        }
-        else {
-            $reply = $this->_redisClient->watch($keys);
-        }
-        return $reply;
+        return $this->_redisClient->watch($keys);
     }
 
     public function multi() {