File tree Expand file tree Collapse file tree
browser-emulator/src/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export class SeleniumService {
3535 private readonly scriptRunnerService : ScriptRunnerService ;
3636
3737 private recordingScript : ChildProcess | undefined ;
38+ private recordingDockerContainerId : string | undefined ;
3839 private isRecordingFullScreen = false ;
3940
4041 private readonly dockerizedSessionContainers = new Map < string , string > ( ) ;
@@ -450,7 +451,8 @@ export class SeleniumService {
450451 Env : [ `FILE_NAME=session_${ dateNow } .mp4` ] ,
451452 } ;
452453
453- await this . dockerService . startContainer ( createOptions ) ;
454+ this . recordingDockerContainerId =
455+ await this . dockerService . startContainer ( createOptions ) ;
454456 } else {
455457 const ffmpegCommand = [
456458 'ffmpeg -hide_banner -loglevel warning -nostdin -y' ,
@@ -484,5 +486,11 @@ export class SeleniumService {
484486 console . log ( 'Stopping full screen recording' ) ;
485487 await this . scriptRunnerService . killDetached ( this . recordingScript ) ;
486488 }
489+ if ( this . recordingDockerContainerId ) {
490+ console . log ( 'Stopping full screen recording container' ) ;
491+ await this . dockerService . removeContainer (
492+ this . recordingDockerContainerId ,
493+ ) ;
494+ }
487495 }
488496}
You can’t perform that action at this time.
0 commit comments