@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.
@@ -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
- certManager
527
- .start()
528
- .then(() => logger.info('start certificate manager service successfully'))
529
- .catch((error) => logger.error('start certificate manager service failed', { error }));
530
-
531
- if (process.env.NODE_ENV === 'development') {
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
- initCron();
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
- } else {
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, () => {
@@ -39,7 +39,7 @@ const getSysInfo = async () => {
39
39
  used: x.used,
40
40
  free: x.size - x.used,
41
41
  }))
42
- .filter((x) => x.total > 0),
42
+ .filter((x) => x.total > 0 && x.mountPoint.startsWith('/')),
43
43
  };
44
44
  };
45
45
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.8-beta-56e84f3c",
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-56e84f3c",
23
- "@abtnode/certificate-manager": "1.16.8-beta-56e84f3c",
24
- "@abtnode/constant": "1.16.8-beta-56e84f3c",
25
- "@abtnode/cron": "1.16.8-beta-56e84f3c",
26
- "@abtnode/db": "1.16.8-beta-56e84f3c",
27
- "@abtnode/logger": "1.16.8-beta-56e84f3c",
28
- "@abtnode/queue": "1.16.8-beta-56e84f3c",
29
- "@abtnode/rbac": "1.16.8-beta-56e84f3c",
30
- "@abtnode/router-provider": "1.16.8-beta-56e84f3c",
31
- "@abtnode/static-server": "1.16.8-beta-56e84f3c",
32
- "@abtnode/timemachine": "1.16.8-beta-56e84f3c",
33
- "@abtnode/util": "1.16.8-beta-56e84f3c",
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-56e84f3c",
45
- "@blocklet/meta": "1.16.8-beta-56e84f3c",
46
- "@blocklet/sdk": "1.16.8-beta-56e84f3c",
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": "2abfe83fcd951169a59719addb3dc3c1bbf8789f"
98
+ "gitHead": "681bf5cac8fc4c4b90c64ad4c6a4faaa99a81f97"
99
99
  }