Skip to content

Commit 5d24895

Browse files
committed
fix(sse): remove unused variables
1 parent fcdb64e commit 5d24895

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

app/controllers/api/v1/sse.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
const { conns } = require('../../../../helpers/bree-hooks');
2-
3-
let uuid = 0;
4-
51
async 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

0 commit comments

Comments
 (0)