示例#1
0
 /**
  * Properly close the connection.
  *
  * {@inheritdoc}
  */
 public function __destruct()
 {
     if ($this->redis instanceof \Redis) {
         try {
             $this->redis->close();
         } catch (\RedisException $e) {
             /*
              * \Redis::close will throw a \RedisException("Redis server went away") exception if
              * we haven't previously been able to connect to Redis or the connection has severed.
              */
         }
     }
 }
示例#2
0
 /**
  * Properly close the connection.
  *
  * {@inheritdoc}
  */
 public function __destruct()
 {
     if ($this->redis instanceof \Redis) {
         $this->redis->close();
     }
 }