bdy 1.18.31-stage → 1.18.32-dev
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/distTs/package.json +1 -1
- package/distTs/src/agent/wait.js +17 -16
- package/distTs/src/agent/windows.js +8 -2
- package/distTs/src/output.js +1 -0
- package/package.json +1 -1
package/distTs/package.json
CHANGED
package/distTs/src/agent/wait.js
CHANGED
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const utils_1 = require("../utils");
|
|
4
4
|
const waitUntilAgentEnabled = async (api, timeout, onTimeout, onSuccess) => {
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
s
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
let remaining = timeout;
|
|
6
|
+
while (remaining >= 1000) {
|
|
7
|
+
let s;
|
|
8
|
+
try {
|
|
9
|
+
s = await api.fetchStatus();
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
s = {};
|
|
13
|
+
}
|
|
14
|
+
if (s.enabled) {
|
|
15
|
+
return onSuccess();
|
|
16
|
+
}
|
|
17
|
+
remaining -= 1000;
|
|
18
|
+
if (remaining >= 1000) {
|
|
19
|
+
await (0, utils_1.sleep)(1000);
|
|
20
|
+
}
|
|
21
21
|
}
|
|
22
|
+
return onTimeout();
|
|
22
23
|
};
|
|
23
24
|
exports.default = waitUntilAgentEnabled;
|
|
@@ -117,8 +117,14 @@ class AgentWindows extends system_1.default {
|
|
|
117
117
|
if (user && pass) {
|
|
118
118
|
await this.nssm(`set bdy ObjectName ${user} ${pass}`);
|
|
119
119
|
}
|
|
120
|
-
if (start)
|
|
121
|
-
|
|
120
|
+
if (start) {
|
|
121
|
+
try {
|
|
122
|
+
await this.start();
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// do nothing, it will throw operation pending
|
|
126
|
+
}
|
|
127
|
+
}
|
|
122
128
|
logger_1.default.info(texts_1.LOG_AGENT_ENABLED);
|
|
123
129
|
}
|
|
124
130
|
catch (err) {
|
package/distTs/src/output.js
CHANGED