2424use Doctrine \Common \Collections \ArrayCollection ;
2525use Doctrine \Common \Collections \Criteria ;
2626use Doctrine \ORM \Mapping as ORM ;
27+ use Illuminate \Support \Facades \Cache ;
2728use Illuminate \Support \Facades \Config ;
2829use Illuminate \Support \Facades \Log ;
2930use models \exceptions \ValidationException ;
@@ -1216,6 +1217,8 @@ public function getStreamDuration():int{
12161217 public function setStreamingUrl (?string $ streaming_url ): void
12171218 {
12181219 $ this ->streaming_url = $ streaming_url ;
1220+ $ key = $ this ->getSecureStreamCacheKey ();
1221+ if (Cache::has ($ key )) Cache::forget ($ key );
12191222 }
12201223
12211224 /**
@@ -1458,6 +1461,8 @@ public function setStreamingType(string $streaming_type): void
14581461 if (!in_array ($ streaming_type , self ::ValidStreamingTypes))
14591462 throw new ValidationException (sprintf ("%s is not a valid streaming type " , $ streaming_type ));
14601463 $ this ->streaming_type = $ streaming_type ;
1464+ $ key = $ this ->getSecureStreamCacheKey ();
1465+ if (Cache::has ($ key )) Cache::forget ($ key );
14611466 }
14621467
14631468 /**
@@ -1570,6 +1575,10 @@ public function IsSecureStream(): bool
15701575 return $ this ->stream_is_secure ;
15711576 }
15721577
1578+ public function getSecureStreamCacheKey ():string {
1579+ return sprintf ("event_%s_secure_stream " , $ this ->id );
1580+ }
1581+
15731582 /**
15741583 * @param bool $stream_is_secure
15751584 */
@@ -1578,6 +1587,9 @@ public function setStreamIsSecure(bool $stream_is_secure): void
15781587 Log::debug (sprintf ("SummitEvent::setStreamIsSecure summit %s event %s stream_is_secure %s " , $ this ->summit ->getId (), $ this ->id , $ stream_is_secure ));
15791588 $ this ->stream_is_secure = $ stream_is_secure ;
15801589
1590+ $ key = $ this ->getSecureStreamCacheKey ();
1591+ if (Cache::has ($ key )) Cache::forget ($ key );
1592+
15811593 if ($ this ->hasSummit () && $ this ->stream_is_secure && !$ this ->summit ->hasMuxPrivateKey ())
15821594 CreateMUXURLSigningKeyForSummit::dispatch ($ this ->summit ->getId ());
15831595 }
0 commit comments