perf: 重构敏感词过滤为DFA算法,并引入WebSocket房间频道鉴权Redis缓存
This commit is contained in:
+3
-1
@@ -9,7 +9,9 @@ Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
|
||||
// 聊天室房间 Presence Channel 鉴权与成员信息抓取
|
||||
Broadcast::channel('room.{roomId}', function ($user, $roomId) {
|
||||
$room = \App\Models\Room::find($roomId);
|
||||
$room = \Illuminate\Support\Facades\Cache::remember("room:meta:{$roomId}", 300, function () use ($roomId) {
|
||||
return \App\Models\Room::find($roomId);
|
||||
});
|
||||
if (! $room || ! $room->canUserEnter($user)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user