@scrypted/server 0.123.30 → 0.123.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cluster/cluster-labels.js +1 -0
- package/dist/cluster/cluster-labels.js.map +1 -1
- package/dist/plugin/device.d.ts +60 -0
- package/dist/plugin/device.js +249 -0
- package/dist/plugin/device.js.map +1 -0
- package/dist/plugin/endpoint.d.ts +45 -0
- package/dist/plugin/endpoint.js +97 -0
- package/dist/plugin/endpoint.js.map +1 -0
- package/dist/plugin/plugin-remote-worker.js +8 -7
- package/dist/plugin/plugin-remote-worker.js.map +1 -1
- package/dist/plugin/plugin-remote.d.ts +2 -51
- package/dist/plugin/plugin-remote.js +6 -337
- package/dist/plugin/plugin-remote.js.map +1 -1
- package/dist/plugin/runtime/cluster-fork-worker.d.ts +3 -3
- package/dist/plugin/runtime/cluster-fork-worker.js +5 -1
- package/dist/plugin/runtime/cluster-fork-worker.js.map +1 -1
- package/dist/plugin/system.js +0 -1
- package/dist/plugin/system.js.map +1 -1
- package/dist/runtime.d.ts +4 -4
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +1 -1
- package/dist/scrypted-cluster-main.d.ts +12 -2
- package/dist/scrypted-cluster-main.js +30 -4
- package/dist/scrypted-cluster-main.js.map +1 -1
- package/dist/services/cluster-fork.d.ts +2 -2
- package/dist/services/cluster-fork.js +4 -3
- package/dist/services/cluster-fork.js.map +1 -1
- package/package.json +2 -2
- package/python/cluster_labels.py +2 -2
- package/python/cluster_setup.py +1 -1
- package/python/plugin_console.py +8 -0
- package/python/plugin_remote.py +105 -34
- package/python/rpc.py +5 -4
- package/src/cluster/cluster-labels.ts +1 -0
- package/src/plugin/device.ts +261 -0
- package/src/plugin/endpoint.ts +109 -0
- package/src/plugin/plugin-remote-worker.ts +14 -10
- package/src/plugin/plugin-remote.ts +6 -364
- package/src/plugin/runtime/cluster-fork-worker.ts +10 -5
- package/src/plugin/system.ts +0 -1
- package/src/runtime.ts +4 -4
- package/src/scrypted-cluster-main.ts +39 -9
- package/src/services/cluster-fork.ts +5 -5
@@ -1,9 +1,8 @@
|
|
1
|
-
import type { ScryptedRuntime } from "../runtime";
|
2
1
|
import { matchesClusterLabels } from "../cluster/cluster-labels";
|
3
|
-
import {
|
4
|
-
import {
|
2
|
+
import type { ScryptedRuntime } from "../runtime";
|
3
|
+
import type { ClusterForkOptions, ClusterForkParam, PeerLiveness, RunningClusterWorker } from "../scrypted-cluster-main";
|
5
4
|
|
6
|
-
export class
|
5
|
+
export class ClusterForkService {
|
7
6
|
constructor(public runtime: ScryptedRuntime) { }
|
8
7
|
|
9
8
|
async fork(peerLiveness: PeerLiveness, options: ClusterForkOptions, packageJson: any, zipHash: string, getZip: () => Promise<Buffer>) {
|
@@ -18,7 +17,7 @@ export class ClusterFork {
|
|
18
17
|
});
|
19
18
|
matchingWorkers.sort((a, b) => b.worker.labels.length - a.worker.labels.length);
|
20
19
|
|
21
|
-
let worker:
|
20
|
+
let worker: RunningClusterWorker;
|
22
21
|
|
23
22
|
// try to keep fork id affinity to single worker if present. this presents the opportunity for
|
24
23
|
// IPC.
|
@@ -36,6 +35,7 @@ export class ClusterFork {
|
|
36
35
|
|
37
36
|
const fork: ClusterForkParam = await worker.peer.getParam('fork');
|
38
37
|
const forkResult = await fork(peerLiveness, options.runtime, packageJson, zipHash, getZip);
|
38
|
+
options.id ||= this.runtime.findPluginDevice(packageJson.name)?._id;
|
39
39
|
worker.forks.add(options);
|
40
40
|
forkResult.waitKilled().catch(() => { }).finally(() => {
|
41
41
|
worker.forks.delete(options);
|