vona-module-a-startup 5.0.14 → 5.0.16
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/dist/.metadata/index.d.ts +12 -0
- package/dist/index.js +17 -7
- package/package.json +1 -1
|
@@ -9,6 +9,10 @@ declare module 'vona-module-a-bean' {
|
|
|
9
9
|
declare module 'vona-module-a-startup' {
|
|
10
10
|
interface ServiceStartup {
|
|
11
11
|
}
|
|
12
|
+
interface ServiceStartup {
|
|
13
|
+
get $beanFullName(): 'a-startup.service.startup';
|
|
14
|
+
get $onionName(): 'a-startup:startup';
|
|
15
|
+
}
|
|
12
16
|
}
|
|
13
17
|
/** service: end */
|
|
14
18
|
/** service: begin */
|
|
@@ -36,6 +40,10 @@ declare module 'vona-module-a-cache' {
|
|
|
36
40
|
declare module 'vona-module-a-startup' {
|
|
37
41
|
interface CacheRedisStartupDebounce {
|
|
38
42
|
}
|
|
43
|
+
interface CacheRedisStartupDebounce {
|
|
44
|
+
get $beanFullName(): 'a-startup.cacheRedis.startupDebounce';
|
|
45
|
+
get $onionName(): 'a-startup:startupDebounce';
|
|
46
|
+
}
|
|
39
47
|
}
|
|
40
48
|
/** cacheRedis: end */
|
|
41
49
|
/** cacheRedis: begin */
|
|
@@ -55,6 +63,10 @@ declare module 'vona' {
|
|
|
55
63
|
declare module 'vona-module-a-startup' {
|
|
56
64
|
interface MetaRedlock {
|
|
57
65
|
}
|
|
66
|
+
interface MetaRedlock {
|
|
67
|
+
get $beanFullName(): 'a-startup.meta.redlock';
|
|
68
|
+
get $onionName(): 'a-startup:redlock';
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
71
|
/** meta: end */
|
|
60
72
|
/** meta redlock: begin */
|
package/dist/index.js
CHANGED
|
@@ -33,14 +33,16 @@ let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// version init : force: should be false
|
|
36
|
-
if (this.app.meta.isTest || this.app.meta.
|
|
36
|
+
if (this.app.meta.isTest || this.app.meta.isDev) {
|
|
37
37
|
const instanceName = '';
|
|
38
38
|
await this.bean.executor.newCtx(async () => {
|
|
39
39
|
await this.$scope.instance.service.instance.instanceStartup(instanceName, {
|
|
40
40
|
force: false
|
|
41
41
|
});
|
|
42
42
|
}, {
|
|
43
|
-
dbInfo:
|
|
43
|
+
dbInfo: {
|
|
44
|
+
level: 1
|
|
45
|
+
},
|
|
44
46
|
instanceName
|
|
45
47
|
});
|
|
46
48
|
} else {
|
|
@@ -48,7 +50,9 @@ let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
|
|
|
48
50
|
const instances = await this.bean.executor.newCtx(async () => {
|
|
49
51
|
return await this.bean.instance.list();
|
|
50
52
|
}, {
|
|
51
|
-
dbInfo:
|
|
53
|
+
dbInfo: {
|
|
54
|
+
level: 1
|
|
55
|
+
}
|
|
52
56
|
});
|
|
53
57
|
for (const instance of instances) {
|
|
54
58
|
const instanceName = instance.name;
|
|
@@ -58,7 +62,9 @@ let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
|
|
|
58
62
|
force: false
|
|
59
63
|
});
|
|
60
64
|
}, {
|
|
61
|
-
dbInfo:
|
|
65
|
+
dbInfo: {
|
|
66
|
+
level: 1
|
|
67
|
+
},
|
|
62
68
|
instanceName
|
|
63
69
|
});
|
|
64
70
|
}
|
|
@@ -70,7 +76,9 @@ let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
|
|
|
70
76
|
await this.bean.executor.newCtx(async () => {
|
|
71
77
|
await this.$scope.version.service.version.__instanceTest(instanceName);
|
|
72
78
|
}, {
|
|
73
|
-
dbInfo:
|
|
79
|
+
dbInfo: {
|
|
80
|
+
level: 1
|
|
81
|
+
},
|
|
74
82
|
instanceName
|
|
75
83
|
});
|
|
76
84
|
}
|
|
@@ -111,7 +119,9 @@ let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
|
|
|
111
119
|
const bean = cast(this.bean._getBean(startup.beanOptions.beanFullName));
|
|
112
120
|
await bean.execute(options);
|
|
113
121
|
}, {
|
|
114
|
-
dbInfo:
|
|
122
|
+
dbInfo: {
|
|
123
|
+
level: 1
|
|
124
|
+
},
|
|
115
125
|
instanceName,
|
|
116
126
|
transaction: startupOptions.transaction
|
|
117
127
|
});
|
|
@@ -140,7 +150,7 @@ let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
|
|
|
140
150
|
async _clearResources() {
|
|
141
151
|
if (!this.app.meta.isTest) return;
|
|
142
152
|
// redis
|
|
143
|
-
await this.$scope.redis.service.
|
|
153
|
+
await this.$scope.redis.service.redis.clearAllData();
|
|
144
154
|
// .app/public
|
|
145
155
|
await fse.remove(path.join(this.app.config.server.publicDir, '1'));
|
|
146
156
|
}
|