@midwayjs/consul 3.9.9 → 3.10.0
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/configuration.js +11 -13
- package/dist/lib/provider.js +1 -1
- package/package.json +7 -7
package/dist/configuration.js
CHANGED
|
@@ -39,19 +39,17 @@ let ConsulConfiguration = class ConsulConfiguration {
|
|
|
39
39
|
if (this.shouldBeRegisterMe) {
|
|
40
40
|
config.name = config.name || app.getProjectName();
|
|
41
41
|
config.id = config.id || `${config.name}:${address}:${port}`;
|
|
42
|
-
config.check
|
|
43
|
-
config.check
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
interval: '3s',
|
|
54
|
-
});
|
|
42
|
+
if (!config.check && config.check !== false) {
|
|
43
|
+
config.check = ['egg', 'koa', 'express'].includes(app.getNamespace())
|
|
44
|
+
? {
|
|
45
|
+
http: `http://${address}:${port}/consul/health/self/check`,
|
|
46
|
+
interval: '3s',
|
|
47
|
+
}
|
|
48
|
+
: {
|
|
49
|
+
tcp: `${address}:${port}`,
|
|
50
|
+
interval: '3s',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
55
53
|
Object.assign(this.consulRegisterConfig, config);
|
|
56
54
|
// 把原始的 consul 对象注入到容器
|
|
57
55
|
container.registerObject('consul:consul', this.consulProvider.getConsul());
|
package/dist/lib/provider.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/consul",
|
|
3
3
|
"description": "midway consul",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.10.0",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"index.d.ts"
|
|
11
11
|
],
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@midwayjs/core": "^3.
|
|
14
|
-
"@midwayjs/koa": "^3.
|
|
15
|
-
"@midwayjs/mock": "^3.
|
|
13
|
+
"@midwayjs/core": "^3.10.0",
|
|
14
|
+
"@midwayjs/koa": "^3.10.0",
|
|
15
|
+
"@midwayjs/mock": "^3.10.0",
|
|
16
16
|
"@types/consul": "0.40.0",
|
|
17
17
|
"@types/sinon": "10.0.13",
|
|
18
|
-
"nock": "13.
|
|
18
|
+
"nock": "13.3.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"consul": "
|
|
21
|
+
"consul": "1.2.0"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"consul"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"type": "git",
|
|
40
40
|
"url": "https://github.com/midwayjs/midway.git"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "33d28f1a020963404488e866432916fd15c0952c"
|
|
43
43
|
}
|