24
24
use Doctrine \Common \Collections \ArrayCollection ;
25
25
use Doctrine \Common \Collections \Criteria ;
26
26
use Doctrine \ORM \Mapping as ORM ;
27
+ use Illuminate \Support \Facades \Cache ;
27
28
use Illuminate \Support \Facades \Config ;
28
29
use Illuminate \Support \Facades \Log ;
29
30
use models \exceptions \ValidationException ;
@@ -1216,6 +1217,8 @@ public function getStreamDuration():int{
1216
1217
public function setStreamingUrl (?string $ streaming_url ): void
1217
1218
{
1218
1219
$ this ->streaming_url = $ streaming_url ;
1220
+ $ key = $ this ->getSecureStreamCacheKey ();
1221
+ if (Cache::has ($ key )) Cache::forget ($ key );
1219
1222
}
1220
1223
1221
1224
/**
@@ -1458,6 +1461,8 @@ public function setStreamingType(string $streaming_type): void
1458
1461
if (!in_array ($ streaming_type , self ::ValidStreamingTypes))
1459
1462
throw new ValidationException (sprintf ("%s is not a valid streaming type " , $ streaming_type ));
1460
1463
$ this ->streaming_type = $ streaming_type ;
1464
+ $ key = $ this ->getSecureStreamCacheKey ();
1465
+ if (Cache::has ($ key )) Cache::forget ($ key );
1461
1466
}
1462
1467
1463
1468
/**
@@ -1570,6 +1575,10 @@ public function IsSecureStream(): bool
1570
1575
return $ this ->stream_is_secure ;
1571
1576
}
1572
1577
1578
+ public function getSecureStreamCacheKey ():string {
1579
+ return sprintf ("event_%s_secure_stream " , $ this ->id );
1580
+ }
1581
+
1573
1582
/**
1574
1583
* @param bool $stream_is_secure
1575
1584
*/
@@ -1578,6 +1587,9 @@ public function setStreamIsSecure(bool $stream_is_secure): void
1578
1587
Log::debug (sprintf ("SummitEvent::setStreamIsSecure summit %s event %s stream_is_secure %s " , $ this ->summit ->getId (), $ this ->id , $ stream_is_secure ));
1579
1588
$ this ->stream_is_secure = $ stream_is_secure ;
1580
1589
1590
+ $ key = $ this ->getSecureStreamCacheKey ();
1591
+ if (Cache::has ($ key )) Cache::forget ($ key );
1592
+
1581
1593
if ($ this ->hasSummit () && $ this ->stream_is_secure && !$ this ->summit ->hasMuxPrivateKey ())
1582
1594
CreateMUXURLSigningKeyForSummit::dispatch ($ this ->summit ->getId ());
1583
1595
}
0 commit comments