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
-
5
1
async function connect ( ctx ) {
6
2
if ( ctx . sse ) {
7
3
// likely not the best way to do this
@@ -25,8 +21,6 @@ async function connect(ctx) {
25
21
data : isActive ( ctx )
26
22
} ) ;
27
23
28
- conns . push ( { id : uuid , sse : ctx . sse } ) ;
29
-
30
24
// send bree events over sse
31
25
for ( const event of [ 'worker created' , 'worker deleted' ] ) {
32
26
ctx . bree . on ( event , ( name ) => {
@@ -45,18 +39,8 @@ async function connect(ctx) {
45
39
ctx . sse . on ( 'close' , ( ) => {
46
40
ctx . logger . error ( 'SSE closed' ) ;
47
41
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
-
55
42
clearInterval ( interval ) ;
56
43
} ) ;
57
-
58
- // bump uuid
59
- uuid ++ ;
60
44
}
61
45
}
62
46
You can’t perform that action at this time.
0 commit comments