@remix_labs/machine-starter 2.2025.0 → 2.2029.0

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/common.js CHANGED
@@ -2,25 +2,28 @@ import { GROOVEBOX_BUILD } from "./groovebox_build.js";
2
2
  import { nanoid } from "nanoid";
3
3
 
4
4
  let workers = {};
5
- let parents = {};
5
+ let children = {};
6
6
 
7
7
  function terminateAll() {
8
8
  for (let [vmID, worker] of Object.entries(workers)) {
9
9
  worker.terminate();
10
10
  };
11
11
  workers = {};
12
- parents = {};
12
+ children = {};
13
13
  }
14
14
 
15
15
  function terminateVM(vmID) {
16
16
  let worker = workers[vmID];
17
17
  if (worker) {
18
+ let vmChildren = children[vmID];
18
19
  delete workers[vmID];
19
- delete parents[vmID];
20
+ delete children[vmID];
20
21
  worker.terminate();
21
- for (let [subID, parentID] of Object.entries(parents)) {
22
- terminateVM(subID);
23
- };
22
+ if (vmChildren) {
23
+ for (let subID of vmChildren) {
24
+ terminateVM(subID)
25
+ }
26
+ }
24
27
  }
25
28
  }
26
29
 
@@ -108,7 +111,9 @@ async function ffi_vm_start(conn, args) {
108
111
  config[k] = v;
109
112
  }
110
113
  config["vmID"] = vm_id;
111
- parents[vm_id] = conn.config.vmID;
114
+ let vmChildren = children[conn.config.vmID];
115
+ if (!vmChildren) vmChildren = [];
116
+ vmChildren.push(vm_id);
112
117
  let arg_config = args[0];
113
118
  if (arg_config.interceptFFI !== undefined)
114
119
  config["interceptFFI"] = arg_config.interceptFFI;
@@ -1,2 +1,2 @@
1
- var GROOVEBOX_BUILD = "2162";
1
+ var GROOVEBOX_BUILD = "2167";
2
2
  export { GROOVEBOX_BUILD }