@naturalcycles/backend-lib 6.2.0 → 6.3.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.
|
@@ -13,7 +13,7 @@ exports.deployHealthCheckYargsOptions = {
|
|
|
13
13
|
},
|
|
14
14
|
thresholdUnhealthy: {
|
|
15
15
|
type: 'number',
|
|
16
|
-
default:
|
|
16
|
+
default: 3,
|
|
17
17
|
},
|
|
18
18
|
maxTries: {
|
|
19
19
|
type: 'number',
|
|
@@ -57,7 +57,7 @@ const inspectOpt = {
|
|
|
57
57
|
* Fails after maxTries.
|
|
58
58
|
*/
|
|
59
59
|
async function deployHealthCheck(url, opt = {}) {
|
|
60
|
-
const { thresholdHealthy = 5, thresholdUnhealthy =
|
|
60
|
+
const { thresholdHealthy = 5, thresholdUnhealthy = 3, maxTries = 30, timeoutSec = 30, intervalSec = 1, logOnFailure = true, logOnSuccess, gaeProject, gaeService, gaeVersion, } = opt;
|
|
61
61
|
let attempt = 0;
|
|
62
62
|
let countHealthy = 0;
|
|
63
63
|
let countUnhealthy = 0;
|
|
@@ -17,6 +17,7 @@ function getServerStatusData(projectDir = process.cwd(), extra) {
|
|
|
17
17
|
const t = (0, js_lib_1.localTime)(ts);
|
|
18
18
|
const deployBuildTime = t.toPretty();
|
|
19
19
|
const buildInfo = [t.toStringCompact(), gitBranch, gitRev].filter(Boolean).join('_');
|
|
20
|
+
const { arch, platform } = process;
|
|
20
21
|
return (0, js_lib_1._filterNullishValues)({
|
|
21
22
|
started: getStartedStr(),
|
|
22
23
|
deployBuildTime,
|
|
@@ -25,9 +26,13 @@ function getServerStatusData(projectDir = process.cwd(), extra) {
|
|
|
25
26
|
GAE_APPLICATION,
|
|
26
27
|
GAE_SERVICE,
|
|
27
28
|
GAE_VERSION,
|
|
29
|
+
processInfo: {
|
|
30
|
+
arch,
|
|
31
|
+
platform,
|
|
32
|
+
},
|
|
28
33
|
mem: (0, nodejs_lib_1.memoryUsageFull)(),
|
|
29
34
|
cpuAvg: nodejs_lib_1.processSharedUtil.cpuAvg(),
|
|
30
|
-
|
|
35
|
+
cpuInfo: nodejs_lib_1.processSharedUtil.cpuInfo(),
|
|
31
36
|
versions,
|
|
32
37
|
NODE_OPTIONS,
|
|
33
38
|
...extra,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/backend-lib",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepare": "husky",
|
|
6
6
|
"build": "dev-lib build",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"deploy-health-check-debug2": "yarn tsn ./src/bin/deploy-health-check.ts --url https://api-master2.naturalcycles.com --thresholdUnhealthy 5"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@sentry/node": "^
|
|
21
|
+
"@sentry/node": "^9"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@naturalcycles/db-lib": "^9",
|
|
@@ -43,13 +43,16 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@naturalcycles/bench-lib": "^3",
|
|
45
45
|
"@naturalcycles/dev-lib": "^15",
|
|
46
|
-
"@sentry/node": "^
|
|
46
|
+
"@sentry/node": "^9",
|
|
47
47
|
"@types/ejs": "^3",
|
|
48
48
|
"@types/node": "^22",
|
|
49
49
|
"@types/yargs": "^16",
|
|
50
50
|
"fastify": "^5",
|
|
51
51
|
"jest": "^29"
|
|
52
52
|
},
|
|
53
|
+
"resolutions": {
|
|
54
|
+
"long": "5.2.4"
|
|
55
|
+
},
|
|
53
56
|
"files": [
|
|
54
57
|
"dist",
|
|
55
58
|
"cfg",
|
|
@@ -30,7 +30,7 @@ export const deployHealthCheckYargsOptions = {
|
|
|
30
30
|
},
|
|
31
31
|
thresholdUnhealthy: {
|
|
32
32
|
type: 'number',
|
|
33
|
-
default:
|
|
33
|
+
default: 3,
|
|
34
34
|
},
|
|
35
35
|
maxTries: {
|
|
36
36
|
type: 'number',
|
|
@@ -81,8 +81,8 @@ export async function deployHealthCheck(
|
|
|
81
81
|
): Promise<void> {
|
|
82
82
|
const {
|
|
83
83
|
thresholdHealthy = 5,
|
|
84
|
-
thresholdUnhealthy =
|
|
85
|
-
maxTries =
|
|
84
|
+
thresholdUnhealthy = 3,
|
|
85
|
+
maxTries = 30,
|
|
86
86
|
timeoutSec = 30,
|
|
87
87
|
intervalSec = 1,
|
|
88
88
|
logOnFailure = true,
|
|
@@ -21,6 +21,8 @@ export function getServerStatusData(
|
|
|
21
21
|
const deployBuildTime = t.toPretty()
|
|
22
22
|
const buildInfo = [t.toStringCompact(), gitBranch, gitRev].filter(Boolean).join('_')
|
|
23
23
|
|
|
24
|
+
const { arch, platform } = process
|
|
25
|
+
|
|
24
26
|
return _filterNullishValues({
|
|
25
27
|
started: getStartedStr(),
|
|
26
28
|
deployBuildTime,
|
|
@@ -29,9 +31,13 @@ export function getServerStatusData(
|
|
|
29
31
|
GAE_APPLICATION,
|
|
30
32
|
GAE_SERVICE,
|
|
31
33
|
GAE_VERSION,
|
|
34
|
+
processInfo: {
|
|
35
|
+
arch,
|
|
36
|
+
platform,
|
|
37
|
+
},
|
|
32
38
|
mem: memoryUsageFull(),
|
|
33
39
|
cpuAvg: processSharedUtil.cpuAvg(),
|
|
34
|
-
|
|
40
|
+
cpuInfo: processSharedUtil.cpuInfo(),
|
|
35
41
|
versions,
|
|
36
42
|
NODE_OPTIONS,
|
|
37
43
|
...extra,
|