@openma/cli 0.4.0 → 0.4.1
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/index.js +27 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7103,6 +7103,33 @@ function serviceInstallOpts() {
|
|
|
7103
7103
|
};
|
|
7104
7104
|
}
|
|
7105
7105
|
async function runSetup(opts) {
|
|
7106
|
+
if (process.env.OMA_DEBUG_HANDLES) {
|
|
7107
|
+
let tick = 0;
|
|
7108
|
+
const probe = setInterval(() => {
|
|
7109
|
+
tick += 1;
|
|
7110
|
+
const handles = process._getActiveHandles();
|
|
7111
|
+
const requests = process._getActiveRequests();
|
|
7112
|
+
const hsum = handles.map((h) => h?.constructor?.name ?? "?").reduce((a, k) => {
|
|
7113
|
+
a[k] = (a[k] ?? 0) + 1;
|
|
7114
|
+
return a;
|
|
7115
|
+
}, {});
|
|
7116
|
+
const rsum = requests.map((r) => r?.constructor?.name ?? "?").reduce((a, k) => {
|
|
7117
|
+
a[k] = (a[k] ?? 0) + 1;
|
|
7118
|
+
return a;
|
|
7119
|
+
}, {});
|
|
7120
|
+
process.stderr.write(`
|
|
7121
|
+
[debug t=${tick * 2}s] handles: ${JSON.stringify(hsum)} requests: ${JSON.stringify(rsum)}
|
|
7122
|
+
`);
|
|
7123
|
+
}, 2e3);
|
|
7124
|
+
probe.unref();
|
|
7125
|
+
}
|
|
7126
|
+
try {
|
|
7127
|
+
await runSetupInner(opts);
|
|
7128
|
+
} finally {
|
|
7129
|
+
setImmediate(() => process.exit(0));
|
|
7130
|
+
}
|
|
7131
|
+
}
|
|
7132
|
+
async function runSetupInner(opts) {
|
|
7106
7133
|
const profile = currentProfile();
|
|
7107
7134
|
const profileTag = profile ? ` [profile=${profile}]` : "";
|
|
7108
7135
|
printBanner(`setup \u2014 register this machine with ${opts.serverUrl}${profileTag}`, PKG_VERSION);
|