vona-module-a-broadcast 5.0.21 → 5.0.22

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BeanInfo, BeanBase, BeanSimple, BeanScopeBase, createBeanDecorator } from 'vona';
2
+ import { isNil } from '@cabloy/utils';
2
3
  import { Service, Scope } from 'vona-module-a-bean';
3
4
 
4
5
  var _dec$1, _dec2$1, _class$1;
@@ -43,6 +44,14 @@ let ServiceBroadcast = (_dec$1 = Service(), _dec2$1 = BeanInfo({
43
44
  // broadcast config
44
45
  const broadcastItem = this.bean.onion.broadcast.getOnionSlice(info.broadcastName);
45
46
  const broadcastConfig = this.bean.onion.broadcast.getOnionOptions(info.broadcastName);
47
+ // instance
48
+ const instanceName = info.options?.instanceName;
49
+ const instance = broadcastConfig?.instance !== false;
50
+ // check
51
+ if ((!isNil(instanceName) || instance) && !this.app.meta.appReady) {
52
+ // ignore
53
+ return;
54
+ }
46
55
  // execute
47
56
  return await this.bean.executor.newCtx(async () => {
48
57
  const beanFullName = broadcastItem.beanOptions.beanFullName;
@@ -51,10 +60,10 @@ let ServiceBroadcast = (_dec$1 = Service(), _dec2$1 = BeanInfo({
51
60
  }, {
52
61
  dbInfo: info.options?.dbInfo,
53
62
  locale: info.options?.locale,
54
- instanceName: info.options?.instanceName,
63
+ instanceName,
55
64
  extraData: info.options?.extraData,
56
65
  transaction: broadcastConfig?.transaction,
57
- instance: broadcastConfig?.instance !== false
66
+ instance
58
67
  });
59
68
  }
60
69
  }) || _class$1) || _class$1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-broadcast",
3
3
  "type": "module",
4
- "version": "5.0.21",
4
+ "version": "5.0.22",
5
5
  "title": "a-broadcast",
6
6
  "vonaModule": {
7
7
  "dependencies": {