@abtnode/core 1.16.8-beta-56e84f3c → 1.16.8-beta-7d175032
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/lib/crons/monitor-disk-usage.js +4 -0
- package/lib/index.js +17 -16
- package/lib/util/sysinfo.js +1 -1
- package/package.json +17 -17
|
@@ -10,6 +10,10 @@ const check = async (threshold) => {
|
|
|
10
10
|
const { disks } = await info.getSysInfo();
|
|
11
11
|
for (const disk of disks) {
|
|
12
12
|
const usageRatio = (disk.used / disk.total) * 100;
|
|
13
|
+
if (Number.isNaN(usageRatio)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
const usageRatioPercent = `${usageRatio.toFixed(2)}%`;
|
|
14
18
|
logger.info('check disk usage', { usage: usageRatioPercent, threshold });
|
|
15
19
|
|
package/lib/index.js
CHANGED
|
@@ -522,24 +522,25 @@ function ABTNode(options) {
|
|
|
522
522
|
};
|
|
523
523
|
|
|
524
524
|
if (options.daemon) {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
525
|
+
onStatesReady(() => {
|
|
526
|
+
// start cert manager
|
|
527
|
+
certManager
|
|
528
|
+
.start()
|
|
529
|
+
.then(() => logger.info('Certificate manager service start successfully'))
|
|
530
|
+
.catch((error) => logger.error('Certificate manager service start failed', { error }));
|
|
531
|
+
|
|
532
|
+
// start jobs
|
|
532
533
|
setTimeout(() => {
|
|
533
|
-
|
|
534
|
+
if (process.env.NODE_ENV === 'development') {
|
|
535
|
+
initCron();
|
|
536
|
+
} else {
|
|
537
|
+
pm2Events.resume();
|
|
538
|
+
initCron();
|
|
539
|
+
createCLILog('startServer');
|
|
540
|
+
logger.info('Cron jobs start successfully on daemon start');
|
|
541
|
+
}
|
|
534
542
|
}, 1000);
|
|
535
|
-
}
|
|
536
|
-
// We should only respond to pm2 events when node is alive
|
|
537
|
-
events.on(EVENTS.NODE_STARTED, () => {
|
|
538
|
-
pm2Events.resume();
|
|
539
|
-
initCron();
|
|
540
|
-
createCLILog('startServer');
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
+
});
|
|
543
544
|
}
|
|
544
545
|
|
|
545
546
|
events.on(EVENTS.NODE_STOPPED, () => {
|
package/lib/util/sysinfo.js
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.8-beta-
|
|
6
|
+
"version": "1.16.8-beta-7d175032",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,18 +19,18 @@
|
|
|
19
19
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@abtnode/auth": "1.16.8-beta-
|
|
23
|
-
"@abtnode/certificate-manager": "1.16.8-beta-
|
|
24
|
-
"@abtnode/constant": "1.16.8-beta-
|
|
25
|
-
"@abtnode/cron": "1.16.8-beta-
|
|
26
|
-
"@abtnode/db": "1.16.8-beta-
|
|
27
|
-
"@abtnode/logger": "1.16.8-beta-
|
|
28
|
-
"@abtnode/queue": "1.16.8-beta-
|
|
29
|
-
"@abtnode/rbac": "1.16.8-beta-
|
|
30
|
-
"@abtnode/router-provider": "1.16.8-beta-
|
|
31
|
-
"@abtnode/static-server": "1.16.8-beta-
|
|
32
|
-
"@abtnode/timemachine": "1.16.8-beta-
|
|
33
|
-
"@abtnode/util": "1.16.8-beta-
|
|
22
|
+
"@abtnode/auth": "1.16.8-beta-7d175032",
|
|
23
|
+
"@abtnode/certificate-manager": "1.16.8-beta-7d175032",
|
|
24
|
+
"@abtnode/constant": "1.16.8-beta-7d175032",
|
|
25
|
+
"@abtnode/cron": "1.16.8-beta-7d175032",
|
|
26
|
+
"@abtnode/db": "1.16.8-beta-7d175032",
|
|
27
|
+
"@abtnode/logger": "1.16.8-beta-7d175032",
|
|
28
|
+
"@abtnode/queue": "1.16.8-beta-7d175032",
|
|
29
|
+
"@abtnode/rbac": "1.16.8-beta-7d175032",
|
|
30
|
+
"@abtnode/router-provider": "1.16.8-beta-7d175032",
|
|
31
|
+
"@abtnode/static-server": "1.16.8-beta-7d175032",
|
|
32
|
+
"@abtnode/timemachine": "1.16.8-beta-7d175032",
|
|
33
|
+
"@abtnode/util": "1.16.8-beta-7d175032",
|
|
34
34
|
"@arcblock/did": "1.18.80",
|
|
35
35
|
"@arcblock/did-auth": "1.18.80",
|
|
36
36
|
"@arcblock/did-ext": "^1.18.80",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"@arcblock/pm2-events": "^0.0.5",
|
|
42
42
|
"@arcblock/validator": "^1.18.80",
|
|
43
43
|
"@arcblock/vc": "1.18.80",
|
|
44
|
-
"@blocklet/constant": "1.16.8-beta-
|
|
45
|
-
"@blocklet/meta": "1.16.8-beta-
|
|
46
|
-
"@blocklet/sdk": "1.16.8-beta-
|
|
44
|
+
"@blocklet/constant": "1.16.8-beta-7d175032",
|
|
45
|
+
"@blocklet/meta": "1.16.8-beta-7d175032",
|
|
46
|
+
"@blocklet/sdk": "1.16.8-beta-7d175032",
|
|
47
47
|
"@did-space/client": "^0.2.91",
|
|
48
48
|
"@fidm/x509": "^1.2.1",
|
|
49
49
|
"@ocap/mcrypto": "1.18.80",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"express": "^4.18.2",
|
|
96
96
|
"jest": "^27.5.1"
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "681bf5cac8fc4c4b90c64ad4c6a4faaa99a81f97"
|
|
99
99
|
}
|