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];
 }
Пример #2
0
 /**
  * Purge the whole queue.
  * @return boolean
  */
 public function purge()
 {
     return $this->db->del($this->key);
 }