@abtnode/core 1.16.11-next-bd38e3c7 → 1.16.11-next-9ab6b164

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.
@@ -1437,6 +1437,16 @@ class BlockletManager extends BaseBlockletManager {
1437
1437
  return blocklet;
1438
1438
  }
1439
1439
 
1440
+ // {Record<BlockletStatus, Array<Did>>}
1441
+ const updates = new Map();
1442
+ const addToUpdates = (componentDid, status) => {
1443
+ if (updates.has(status)) {
1444
+ updates.get(status).push(componentDid);
1445
+ } else {
1446
+ updates.set(status, [componentDid]);
1447
+ }
1448
+ };
1449
+
1440
1450
  await forEachComponentV2(
1441
1451
  blocklet,
1442
1452
  async (component) => {
@@ -1452,7 +1462,7 @@ class BlockletManager extends BaseBlockletManager {
1452
1462
  const status = await getProcessState(component.env.processId);
1453
1463
  if (component.status !== status) {
1454
1464
  component.status = status;
1455
- await states.blocklet.setBlockletStatus(did, status, { componentDids: [component.meta.did] });
1465
+ addToUpdates(component.meta.did, status);
1456
1466
  }
1457
1467
  } catch {
1458
1468
  if (
@@ -1467,13 +1477,20 @@ class BlockletManager extends BaseBlockletManager {
1467
1477
  ) {
1468
1478
  const status = BlockletStatus.stopped;
1469
1479
  component.status = status;
1470
- await states.blocklet.setBlockletStatus(did, status, { componentDids: [component.meta.did] });
1480
+ addToUpdates(component.meta.did, status);
1471
1481
  }
1472
1482
  }
1473
1483
  },
1474
1484
  { parallel: true }
1475
1485
  );
1476
1486
 
1487
+ // iterate updates
1488
+ if (updates.size > 0) {
1489
+ for (const [status, dids] of updates) {
1490
+ await states.blocklet.setBlockletStatus(did, status, { componentDids: dids });
1491
+ }
1492
+ }
1493
+
1477
1494
  blocklet.status = getBlockletStatus(blocklet);
1478
1495
 
1479
1496
  return blocklet;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.11-next-bd38e3c7",
6
+ "version": "1.16.11-next-9ab6b164",
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": "Apache-2.0",
21
21
  "dependencies": {
22
- "@abtnode/auth": "1.16.11-next-bd38e3c7",
23
- "@abtnode/certificate-manager": "1.16.11-next-bd38e3c7",
24
- "@abtnode/constant": "1.16.11-next-bd38e3c7",
25
- "@abtnode/cron": "1.16.11-next-bd38e3c7",
26
- "@abtnode/logger": "1.16.11-next-bd38e3c7",
27
- "@abtnode/models": "1.16.11-next-bd38e3c7",
28
- "@abtnode/queue": "1.16.11-next-bd38e3c7",
29
- "@abtnode/rbac": "1.16.11-next-bd38e3c7",
30
- "@abtnode/router-provider": "1.16.11-next-bd38e3c7",
31
- "@abtnode/static-server": "1.16.11-next-bd38e3c7",
32
- "@abtnode/timemachine": "1.16.11-next-bd38e3c7",
33
- "@abtnode/util": "1.16.11-next-bd38e3c7",
22
+ "@abtnode/auth": "1.16.11-next-9ab6b164",
23
+ "@abtnode/certificate-manager": "1.16.11-next-9ab6b164",
24
+ "@abtnode/constant": "1.16.11-next-9ab6b164",
25
+ "@abtnode/cron": "1.16.11-next-9ab6b164",
26
+ "@abtnode/logger": "1.16.11-next-9ab6b164",
27
+ "@abtnode/models": "1.16.11-next-9ab6b164",
28
+ "@abtnode/queue": "1.16.11-next-9ab6b164",
29
+ "@abtnode/rbac": "1.16.11-next-9ab6b164",
30
+ "@abtnode/router-provider": "1.16.11-next-9ab6b164",
31
+ "@abtnode/static-server": "1.16.11-next-9ab6b164",
32
+ "@abtnode/timemachine": "1.16.11-next-9ab6b164",
33
+ "@abtnode/util": "1.16.11-next-9ab6b164",
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.11-next-bd38e3c7",
45
- "@blocklet/meta": "1.16.11-next-bd38e3c7",
46
- "@blocklet/sdk": "1.16.11-next-bd38e3c7",
44
+ "@blocklet/constant": "1.16.11-next-9ab6b164",
45
+ "@blocklet/meta": "1.16.11-next-9ab6b164",
46
+ "@blocklet/sdk": "1.16.11-next-9ab6b164",
47
47
  "@did-space/client": "^0.2.113",
48
48
  "@fidm/x509": "^1.2.1",
49
49
  "@ocap/mcrypto": "1.18.80",
@@ -96,5 +96,5 @@
96
96
  "express": "^4.18.2",
97
97
  "jest": "^27.5.1"
98
98
  },
99
- "gitHead": "d42f3cbfe1702f0dfa184e1db1587f26a05804aa"
99
+ "gitHead": "581bece41a8ede8bbde4d596b5e5d4dff53155fe"
100
100
  }