feat(utilities): WS reduce maxHttpBufferSize
feat(utilities): WS log status each 30s
This commit is contained in:
parent
ecbdfc27bb
commit
2f6a9258fc
2 changed files with 25 additions and 5 deletions
|
|
@ -20,11 +20,11 @@ function build_api(){
|
|||
[[ $1 == "ee" ]] && {
|
||||
cp -rf ../ee/utilities/* ./
|
||||
}
|
||||
docker build -f ./Dockerfile -t ${DOCKER_REPO:-'local'}/utilities:${git_sha1} .
|
||||
docker build -f ./Dockerfile -t ${DOCKER_REPO:-'local'}/utilities:1.5.0 .
|
||||
[[ $PUSH_IMAGE -eq 1 ]] && {
|
||||
docker push ${DOCKER_REPO:-'local'}/utilities:${git_sha1}
|
||||
docker tag ${DOCKER_REPO:-'local'}/utilities:${git_sha1} ${DOCKER_REPO:-'local'}/utilities:latest
|
||||
docker push ${DOCKER_REPO:-'local'}/utilities:latest
|
||||
docker push ${DOCKER_REPO:-'local'}/utilities:1.5.0
|
||||
docker build -f ./Dockerfile -t ${DOCKER_REPO:-'local'}/utilities:1.5.0-ee .
|
||||
docker push ${DOCKER_REPO:-'local'}/utilities:1.5.0-ee
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ module.exports = {
|
|||
wsRouter,
|
||||
start: (server) => {
|
||||
io = _io(server, {
|
||||
maxHttpBufferSize: 7e6,
|
||||
maxHttpBufferSize: 1e6,
|
||||
cors: {
|
||||
origin: "*",
|
||||
methods: ["GET", "POST", "PUT"]
|
||||
|
|
@ -252,5 +252,25 @@ module.exports = {
|
|||
|
||||
});
|
||||
console.log("WS server started")
|
||||
setInterval((io) => {
|
||||
try {
|
||||
let count = 0;
|
||||
console.log(` ====== Rooms: ${io.sockets.adapter.rooms.size} ====== `);
|
||||
const arr = Array.from(io.sockets.adapter.rooms)
|
||||
const filtered = arr.filter(room => !room[1].has(room[0]))
|
||||
for (let i of filtered) {
|
||||
let {projectKey, sessionId} = extractPeerId(i[0]);
|
||||
if (projectKey !== null && sessionId !== null) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
console.log(` ====== Valid Rooms: ${count} ====== `);
|
||||
for (let item of filtered) {
|
||||
console.log(`Room: ${item[0]} connected: ${item[1].size}`)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}, 30000, io);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue