Skip to content

Commit d4e03b1

Browse files
committed
delete the support code for using the socketio cluster module
- confusing - not needed for anything anymore
1 parent a03d97e commit d4e03b1

File tree

6 files changed

+40
-226
lines changed

6 files changed

+40
-226
lines changed

src/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
"version-check": "pip3 install typing_extensions mypy || pip3 install --break-system-packages typing_extensions mypy && ./workspaces.py version-check && mypy scripts/check_npm_packages.py",
1919
"test-parallel": "unset DEBUG && pnpm run version-check && cd packages && pnpm run -r --parallel test",
2020
"test": "unset DEBUG && pnpm run depcheck && pnpm run version-check && ./workspaces.py test",
21-
"test-github-ci": "unset DEBUG && pnpm run depcheck && pnpm run version-check && ./workspaces.py test --exclude=jupyter --retries=1",
21+
"test-github-ci": "unset DEBUG && pnpm run depcheck && pnpm run version-check && ./workspaces.py test --exclude=jupyter,file-server --retries=1",
2222
"depcheck": "cd packages && pnpm run -r --parallel depcheck",
2323
"prettier-all": "cd packages/",
2424
"local-ci": "./scripts/ci.sh",
25-
"conat-server": "cd packages/server && pnpm conat-server",
2625
"conat-connections": "cd packages/backend && pnpm conat-connections",
2726
"conat-watch": "cd packages/backend && pnpm conat-watch",
2827
"conat-inventory": "cd packages/backend && pnpm conat-inventory"

src/packages/pnpm-lock.yaml

Lines changed: 3 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { loadConatConfiguration } from "./configuration";
2+
import { initPersistServer } from "@cocalc/backend/conat/persist";
3+
import { conatPersistCount } from "@cocalc/backend/data";
4+
5+
import getLogger from "@cocalc/backend/logger";
6+
7+
const logger = getLogger("server:conat:persist");
8+
9+
export async function initConatPersist() {
10+
logger.debug("initPersistServer: sqlite3 stream persistence", {
11+
conatPersistCount,
12+
});
13+
if (!conatPersistCount || conatPersistCount <= 1) {
14+
// only 1, so no need to use separate processes
15+
await loadConatConfiguration();
16+
initPersistServer();
17+
return;
18+
}
19+
20+
// more than 1 so no possible value to multiple servers if we don't
21+
// use separate processes
22+
createPersistCluster();
23+
}
24+
25+
async function createPersistCluster() {
26+
logger.debug(
27+
"initPersistServer: creating cluster with",
28+
conatPersistCount,
29+
"nodes",
30+
);
31+
await loadConatConfiguration();
32+
for (let i = 0; i < conatPersistCount; i++) {
33+
initPersistServer();
34+
}
35+
}

src/packages/server/conat/socketio/cluster.ts

Lines changed: 0 additions & 137 deletions
This file was deleted.

src/packages/server/conat/socketio/start-cluster.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/packages/server/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
"tsc": "../node_modules/.bin/tsc --watch --pretty --preserveWatchOutput ",
3838
"test": "TZ=UTC jest --forceExit --runInBand",
3939
"depcheck": "pnpx depcheck",
40-
"prepublishOnly": "test",
41-
"conat-server": "node ./dist/conat/socketio/cluster.js"
40+
"prepublishOnly": "test"
4241
},
4342
"author": "SageMath, Inc.",
4443
"license": "SEE LICENSE.md",
@@ -68,8 +67,6 @@
6867
"@passport-next/passport-oauth2": "^2.1.4",
6968
"@sendgrid/client": "^8.1.4",
7069
"@sendgrid/mail": "^8.1.4",
71-
"@socket.io/cluster-adapter": "^0.2.2",
72-
"@socket.io/sticky": "^1.0.4",
7370
"@zxcvbn-ts/core": "^3.0.4",
7471
"@zxcvbn-ts/language-common": "^3.0.4",
7572
"@zxcvbn-ts/language-en": "^3.0.2",

0 commit comments

Comments
 (0)