Update LiveStreamController, clear chat after stream ends

This commit is contained in:
Daniel Supernault 2022-06-26 19:37:05 -06:00
parent 020f810a7e
commit f51ffa7eab
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 3 additions and 1 deletions

View file

@ -389,6 +389,8 @@ class LiveStreamController extends Controller
$stream = LiveStream::whereStreamId($name)->whereStreamKey($url['key'])->firstOrFail(); $stream = LiveStream::whereStreamId($name)->whereStreamKey($url['key'])->firstOrFail();
LiveStreamService::clearChat($stream->profile_id);
if(config('livestreaming.broadcast.delete_token_after_finished')) { if(config('livestreaming.broadcast.delete_token_after_finished')) {
$stream->delete(); $stream->delete();
} else { } else {

View file

@ -39,7 +39,7 @@ class LiveStreamService
return Redis::lrem($key, 0, $val); return Redis::lrem($key, 0, $val);
} }
public static function clearChat($id, $val) public static function clearChat($id)
{ {
$key = self::CACHE_KEY . 'chat:' . $id; $key = self::CACHE_KEY . 'chat:' . $id;
return Redis::del($key); return Redis::del($key);