@abtnode/core 1.17.4-beta-20251204-152224-243ff54f → 1.17.4-beta-20251205-104405-28838df1

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.
@@ -25,8 +25,10 @@ class EnsureBlockletRunning {
25
25
 
26
26
  whenCycleCheck = false;
27
27
 
28
+ cycleCheckCount = 0;
29
+
28
30
  // 每次任务的最小间隔时间
29
- checkInterval = +process.env.ABT_NODE_ENSURE_RUNNING_CHECK_INTERVAL || 180 * 1000;
31
+ checkInterval = +process.env.ABT_NODE_ENSURE_RUNNING_CHECK_INTERVAL || 120 * 1000;
30
32
 
31
33
  minCheckInterval = 30_000;
32
34
 
@@ -143,7 +145,11 @@ class EnsureBlockletRunning {
143
145
 
144
146
  // 每次检查完之后查看消耗的时间
145
147
  await sleep(Math.max(this.checkInterval, this.minCheckInterval));
146
- this.whenCycleCheck = true;
148
+ this.cycleCheckCount++;
149
+ if (this.cycleCheckCount >= 3) {
150
+ this.cycleCheckCount = 0;
151
+ this.whenCycleCheck = true;
152
+ }
147
153
  } catch (e) {
148
154
  logger.error('check and fix blocklet status failed', e);
149
155
  // 出错时也要等待,避免频繁重试
@@ -533,13 +539,37 @@ class EnsureBlockletRunning {
533
539
  }
534
540
 
535
541
  logger.info('restart blocklet:', rootDid, componentDids);
536
- await this.start({
537
- did: rootDid,
538
- componentDids,
539
- checkHealthImmediately: true,
540
- atomic: true,
541
- operator: 'ensure-blocklet-running',
542
- });
542
+ try {
543
+ await this.start({
544
+ did: rootDid,
545
+ componentDids,
546
+ checkHealthImmediately: true,
547
+ atomic: true,
548
+ operator: 'ensure-blocklet-running',
549
+ });
550
+ } catch (e) {
551
+ // 如果启动失败,则尝试启动一次 error 状态的组件
552
+ const blocklet = await this.states.blocklet.getBlocklet(rootDid);
553
+ if (blocklet) {
554
+ const errorComponentDids = blocklet.children
555
+ .filter((child) => child.status === BlockletStatus.error || child.greenStatus === BlockletStatus.error)
556
+ .map((child) => child.meta.did);
557
+ if (errorComponentDids.length) {
558
+ logger.error('restart blocklet failed, retry with once, error:', e);
559
+ await this.start({
560
+ did: rootDid,
561
+ componentDids: errorComponentDids,
562
+ checkHealthImmediately: true,
563
+ atomic: true,
564
+ operator: 'ensure-blocklet-running',
565
+ });
566
+ } else {
567
+ throw e;
568
+ }
569
+ } else {
570
+ throw e;
571
+ }
572
+ }
543
573
  this.handleRestartSuccess(rootDid, componentDids, firstCycle, context);
544
574
  } catch (e) {
545
575
  await this.handleRestartFailure(rootDid, componentDids, context, e);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.17.4-beta-20251204-152224-243ff54f",
6
+ "version": "1.17.4-beta-20251205-104405-28838df1",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -17,21 +17,21 @@
17
17
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@abtnode/analytics": "1.17.4-beta-20251204-152224-243ff54f",
21
- "@abtnode/auth": "1.17.4-beta-20251204-152224-243ff54f",
22
- "@abtnode/certificate-manager": "1.17.4-beta-20251204-152224-243ff54f",
23
- "@abtnode/constant": "1.17.4-beta-20251204-152224-243ff54f",
24
- "@abtnode/cron": "1.17.4-beta-20251204-152224-243ff54f",
25
- "@abtnode/db-cache": "1.17.4-beta-20251204-152224-243ff54f",
26
- "@abtnode/docker-utils": "1.17.4-beta-20251204-152224-243ff54f",
27
- "@abtnode/logger": "1.17.4-beta-20251204-152224-243ff54f",
28
- "@abtnode/models": "1.17.4-beta-20251204-152224-243ff54f",
29
- "@abtnode/queue": "1.17.4-beta-20251204-152224-243ff54f",
30
- "@abtnode/rbac": "1.17.4-beta-20251204-152224-243ff54f",
31
- "@abtnode/router-provider": "1.17.4-beta-20251204-152224-243ff54f",
32
- "@abtnode/static-server": "1.17.4-beta-20251204-152224-243ff54f",
33
- "@abtnode/timemachine": "1.17.4-beta-20251204-152224-243ff54f",
34
- "@abtnode/util": "1.17.4-beta-20251204-152224-243ff54f",
20
+ "@abtnode/analytics": "1.17.4-beta-20251205-104405-28838df1",
21
+ "@abtnode/auth": "1.17.4-beta-20251205-104405-28838df1",
22
+ "@abtnode/certificate-manager": "1.17.4-beta-20251205-104405-28838df1",
23
+ "@abtnode/constant": "1.17.4-beta-20251205-104405-28838df1",
24
+ "@abtnode/cron": "1.17.4-beta-20251205-104405-28838df1",
25
+ "@abtnode/db-cache": "1.17.4-beta-20251205-104405-28838df1",
26
+ "@abtnode/docker-utils": "1.17.4-beta-20251205-104405-28838df1",
27
+ "@abtnode/logger": "1.17.4-beta-20251205-104405-28838df1",
28
+ "@abtnode/models": "1.17.4-beta-20251205-104405-28838df1",
29
+ "@abtnode/queue": "1.17.4-beta-20251205-104405-28838df1",
30
+ "@abtnode/rbac": "1.17.4-beta-20251205-104405-28838df1",
31
+ "@abtnode/router-provider": "1.17.4-beta-20251205-104405-28838df1",
32
+ "@abtnode/static-server": "1.17.4-beta-20251205-104405-28838df1",
33
+ "@abtnode/timemachine": "1.17.4-beta-20251205-104405-28838df1",
34
+ "@abtnode/util": "1.17.4-beta-20251205-104405-28838df1",
35
35
  "@aigne/aigne-hub": "^0.10.10",
36
36
  "@arcblock/did": "^1.27.12",
37
37
  "@arcblock/did-connect-js": "^1.27.12",
@@ -43,15 +43,15 @@
43
43
  "@arcblock/pm2-events": "^0.0.5",
44
44
  "@arcblock/validator": "^1.27.12",
45
45
  "@arcblock/vc": "^1.27.12",
46
- "@blocklet/constant": "1.17.4-beta-20251204-152224-243ff54f",
46
+ "@blocklet/constant": "1.17.4-beta-20251205-104405-28838df1",
47
47
  "@blocklet/did-space-js": "^1.2.6",
48
- "@blocklet/env": "1.17.4-beta-20251204-152224-243ff54f",
48
+ "@blocklet/env": "1.17.4-beta-20251205-104405-28838df1",
49
49
  "@blocklet/error": "^0.3.3",
50
- "@blocklet/meta": "1.17.4-beta-20251204-152224-243ff54f",
51
- "@blocklet/resolver": "1.17.4-beta-20251204-152224-243ff54f",
52
- "@blocklet/sdk": "1.17.4-beta-20251204-152224-243ff54f",
53
- "@blocklet/server-js": "1.17.4-beta-20251204-152224-243ff54f",
54
- "@blocklet/store": "1.17.4-beta-20251204-152224-243ff54f",
50
+ "@blocklet/meta": "1.17.4-beta-20251205-104405-28838df1",
51
+ "@blocklet/resolver": "1.17.4-beta-20251205-104405-28838df1",
52
+ "@blocklet/sdk": "1.17.4-beta-20251205-104405-28838df1",
53
+ "@blocklet/server-js": "1.17.4-beta-20251205-104405-28838df1",
54
+ "@blocklet/store": "1.17.4-beta-20251205-104405-28838df1",
55
55
  "@blocklet/theme": "^3.2.11",
56
56
  "@fidm/x509": "^1.2.1",
57
57
  "@ocap/mcrypto": "^1.27.12",
@@ -116,5 +116,5 @@
116
116
  "express": "^4.18.2",
117
117
  "unzipper": "^0.10.11"
118
118
  },
119
- "gitHead": "090b2f960b834168dfa12b2a559b9256a98be312"
119
+ "gitHead": "f8e18c8b32b19fd98de3d292a0036e628e59d474"
120
120
  }