File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ before(async () => {
5353 parent : livestreamServiceClient . locationPath ( projectId , location ) ,
5454 } ) ;
5555 for ( const channel of channels ) {
56- if ( channel . createTime . seconds < DATE_NOW_SEC - THREE_HOURS_IN_SEC ) {
56+ const isTestChannel = channel . name . includes (
57+ 'nodejs-test-livestream-channel'
58+ ) ;
59+ if ( isTestChannel ) {
5760 const request = {
5861 name : channel . name ,
5962 } ;
@@ -68,16 +71,18 @@ before(async () => {
6871 console . log ( err ) ;
6972 }
7073
71- const [ events ] = await livestreamServiceClient . listEvents ( {
72- parent : channel . name ,
73- } ) ;
74-
75- for ( const event of events ) {
76- await livestreamServiceClient . deleteEvent ( {
77- name : event . name ,
74+ if ( channel . createTime . seconds < DATE_NOW_SEC - THREE_HOURS_IN_SEC ) {
75+ const [ events ] = await livestreamServiceClient . listEvents ( {
76+ parent : channel . name ,
7877 } ) ;
78+
79+ for ( const event of events ) {
80+ await livestreamServiceClient . deleteEvent ( {
81+ name : event . name ,
82+ } ) ;
83+ }
84+ await livestreamServiceClient . deleteChannel ( request ) ;
7985 }
80- await livestreamServiceClient . deleteChannel ( request ) ;
8186 }
8287 }
8388
You can’t perform that action at this time.
0 commit comments