Skip to content

Commit bff361c

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

File tree

6 files changed

+40
-227
lines changed

6 files changed

+40
-227
lines changed

src/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
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: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,15 @@
2626
"./settings": "./dist/settings/index.js",
2727
"./settings/*": "./dist/settings/*.js"
2828
},
29-
"keywords": [
30-
"utilities",
31-
"cocalc"
32-
],
29+
"keywords": ["utilities", "cocalc"],
3330
"scripts": {
3431
"preinstall": "npx only-allow pnpm",
3532
"clean": "rm -rf node_modules dist",
3633
"build": "../node_modules/.bin/tsc --build",
3734
"tsc": "../node_modules/.bin/tsc --watch --pretty --preserveWatchOutput ",
3835
"test": "TZ=UTC jest --forceExit --runInBand",
3936
"depcheck": "pnpx depcheck",
40-
"prepublishOnly": "test",
41-
"conat-server": "node ./dist/conat/socketio/cluster.js"
37+
"prepublishOnly": "test"
4238
},
4339
"author": "SageMath, Inc.",
4440
"license": "SEE LICENSE.md",

0 commit comments

Comments
 (0)