/** * @param $group */ protected function deleteCacheGroup($group) { $keys = $this->redis->keys($group . '*'); if (!empty($keys)) { $this->redis->del($keys); } }
/** * 解锁 * * @param string $key */ public function release($name) { $key = $this->getKey($name); if ($this->redis->ttl($key)) { $this->redis->del($key); } }
/** * @param Update $update */ public function proceed(Update $update) { $dialog = self::get($update); if (!$dialog) { return; } $chatId = $dialog->getChat()->getId(); $dialog->proceed(); if ($dialog->isEnd()) { $this->redis->del($chatId); } else { $this->setField($chatId, 'next', $dialog->getNext()); $this->setField($chatId, 'memory', $dialog->getMemory()); } }
/** * Remove an item from the cache. * * @param string $key * @return void */ protected function removeItem($key) { $this->redis->del($this->prefix . $key); }
/** * Remove an item from the cache. * * @param string $key * @return void */ public function forget($key) { $this->redis->del($this->prefix . $key); }