server: apply default runtime for cluster fork

This commit is contained in:
Koushik Dutta
2024-11-18 21:03:00 -08:00
parent 924394d365
commit ca243e79bb
3 changed files with 9 additions and 4 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/server",
"version": "0.123.30",
"version": "0.123.31",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/server",
"version": "0.123.30",
"version": "0.123.31",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -777,7 +777,9 @@ class PluginRemote:
peerLiveness = PeerLiveness(self.loop)
async def startClusterFork():
forkComponent = await self.api.getComponent("cluster-fork")
clusterForkResult = await forkComponent.fork(peerLiveness, options, packageJson, zipHash, lambda: zipAPI.getZip())
sanitizedOptions = options.copy()
sanitizedOptions["runtime"] = sanitizedOptions.get("runtime", "python")
clusterForkResult = await forkComponent.fork(peerLiveness, sanitizedOptions, packageJson, zipHash, lambda: zipAPI.getZip())
async def waitPeerLiveness():
try:

View File

@@ -37,7 +37,10 @@ export function createClusterForkWorker(
});
const peerLiveness = new PeerLiveness(waitKilled.promise);
const clusterForkResultPromise = forkComponentPromise.then(forkComponent => forkComponent.fork(peerLiveness, options, packageJson, zipHash, getZip));
const clusterForkResultPromise = forkComponentPromise.then(forkComponent => forkComponent.fork(peerLiveness, {
runtime: options.runtime || 'node',
...options,
}, packageJson, zipHash, getZip));
clusterForkResultPromise.catch(() => {});
const clusterWorkerId = clusterForkResultPromise.then(clusterForkResult => clusterForkResult.clusterWorkerId);