/** * 保留每路最新的n条message(历史消息),到redis中 */ function storeMessageList($data) { if ($data['type'] == \Config\St\Storekey::BROADCAST_MSG_TYPE) { return false; } Redisq::lpush(array('serverName' => 'webChat', 'key' => $data['chatid'] . \Config\St\Storekey::MSG_HISTORY, 'value' => serialize($data))); //保存最新20条 Redisq::ltrim(array('serverName' => 'webChat', 'key' => $data['chatid'] . \Config\St\Storekey::MSG_HISTORY, 'offset' => 0, 'len' => 20)); }