public function actionDeleteCache(Connection $redis, Response $response) { $data = $errorMsg = ''; try { $redis->del(self::HASH_KEY); $data = 'Кэш сброшен'; } catch (Exception $e) { $errorMsg = $e->getMessage(); } $response->format = Response::FORMAT_JSON; return ['data' => $data, 'error' => $errorMsg]; }
/** * Purge the whole queue. * @return boolean */ public function purge() { return $this->db->del($this->key); }