File tree Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change 1- const { conns } = require ( '../../../../helpers/bree-hooks' ) ;
2-
3- let uuid = 0 ;
4-
51async function connect ( ctx ) {
62 if ( ctx . sse ) {
73 // likely not the best way to do this
@@ -25,8 +21,6 @@ async function connect(ctx) {
2521 data : isActive ( ctx )
2622 } ) ;
2723
28- conns . push ( { id : uuid , sse : ctx . sse } ) ;
29-
3024 // send bree events over sse
3125 for ( const event of [ 'worker created' , 'worker deleted' ] ) {
3226 ctx . bree . on ( event , ( name ) => {
@@ -45,18 +39,8 @@ async function connect(ctx) {
4539 ctx . sse . on ( 'close' , ( ) => {
4640 ctx . logger . error ( 'SSE closed' ) ;
4741
48- // remove from conns array)
49- const idx = conns . findIndex ( ( conn ) => conn . id === uuid ) ;
50-
51- if ( idx > 0 ) {
52- conns . splice ( idx , 1 ) ;
53- }
54-
5542 clearInterval ( interval ) ;
5643 } ) ;
57-
58- // bump uuid
59- uuid ++ ;
6044 }
6145}
6246
You can’t perform that action at this time.
0 commit comments