Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Mkfree Deploy
Commits
84124d83
Commit
84124d83
authored
3 years ago
by
oyhk
Browse files
Options
Download
Email Patches
Plain Diff
[fix]
parent
d0ed851e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/src/plugin-api/nacos/plugin-nacos.service.ts
+6
-0
backend/src/plugin-api/nacos/plugin-nacos.service.ts
backend/src/project/project.service.ts
+6
-1
backend/src/project/project.service.ts
with
12 additions
and
1 deletion
+12
-1
backend/src/plugin-api/nacos/plugin-nacos.service.ts
+
6
-
0
View file @
84124d83
...
...
@@ -115,6 +115,12 @@ export class PluginNacosService {
return
result
;
}
/**
* 修改实例上下线
* @param dto
* @param pluginEurekaConfig
* @return ok
*/
async
instanceChangeStatus
(
dto
:
PluginNacosServiceInstanceDto
,
pluginEurekaConfig
:
PluginNacosConfig
)
{
const
url
=
`
${
pluginEurekaConfig
.
nacosUrl
}
/nacos/v1/ns/instance`
;
const
result
=
await
this
.
httpService
.
put
(
url
,
qs
.
stringify
({
...
...
This diff is collapsed.
Click to expand it.
backend/src/project/project.service.ts
+
6
-
1
View file @
84124d83
...
...
@@ -490,7 +490,7 @@ export class ProjectService {
*/
async
projectAppChangeStatusInNacos
(
dto
:
PluginNacosServiceInstanceDto
,
pluginNacosConfig
:
PluginRegisterCenterConfig
)
{
console
.
log
(
`项目:
${
dto
.
serviceName
}
在 Nacos 注册中心
${
dto
.
ip
}
:
${
dto
.
enabled
}
开始`
);
let
filterInstance
=
{}
as
PluginNacosServiceInstanceDto
;
let
filterInstance
=
{}
as
PluginNacosServiceInstanceDto
;
while
(
true
)
{
const
instanceList
:
PluginNacosServiceInstanceDto
[]
=
await
this
.
pluginNacosService
.
instanceList
(
dto
,
pluginNacosConfig
);
if
(
!
instanceList
)
{
...
...
@@ -504,6 +504,11 @@ export class ProjectService {
break
;
}
// 修改上下线完成结束
if
(
filterInstance
.
enabled
===
dto
.
enabled
)
{
break
;
}
filterInstance
.
enabled
=
dto
.
enabled
;
await
this
.
pluginNacosService
.
instanceChangeStatus
(
filterInstance
,
pluginNacosConfig
);
console
.
log
(
`项目:
${
dto
.
serviceName
}
在 Nacos 注册中心
${
dto
.
ip
}
:
${
dto
.
enabled
}
中...`
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment