diff --git a/System/Cache/Redis.php b/System/Cache/Redis.php index df6ffa02..55c851ef 100644 --- a/System/Cache/Redis.php +++ b/System/Cache/Redis.php @@ -295,12 +295,15 @@ class Redis extends Component */ public function lock($key, $timeout = 5) { - $redis = $this->proxy(); - if (!$redis->setnx($key, 1)) { - return false; - } - $redis->expire($key, $timeout); - return true; + $script = <<