bm2 1.0.25 → 1.0.26
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/package.json +1 -1
- package/src/cluster-manager.ts +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bm2",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "A blazing-fast, full-featured process manager built entirely on Bun native APIs. The modern PM2 replacement — zero Node.js dependencies, pure Bun performance.",
|
|
5
5
|
"main": "src/api.ts",
|
|
6
6
|
"module": "src/api.ts",
|
package/src/cluster-manager.ts
CHANGED
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
* License: GPL-3.0-only
|
|
14
14
|
* Author: Zak <zak@maxxpainn.com>
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
import type { Subprocess } from "bun";
|
|
17
|
+
import type { ProcessDescription } from "./types";
|
|
18
|
+
import { getCpuCount } from "./utils";
|
|
19
|
+
import path from "path"
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
export class ClusterManager {
|
|
21
22
|
private workers: Map<number, Map<number, Subprocess>> = new Map();
|
|
22
23
|
|
|
23
24
|
resolveInstances(instances: number | string | undefined): number {
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
cmd.push(...config.nodeArgs);
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
cmd.push(config.script);
|
|
71
|
+
cmd.push(path.resolve(config.script));
|
|
71
72
|
if (config.args?.length) cmd.push(...config.args);
|
|
72
73
|
|
|
73
74
|
return cmd;
|