Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
szh
chain33-pai
Commits
4f5bec10
Commit
4f5bec10
authored
Nov 02, 2021
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户手动升级节点接口只覆盖程序 接口发送重启信号给程序后台自动重启
parent
6551a389
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
node.go
routers/api/v1/node.go
+18
-16
No files found.
routers/api/v1/node.go
View file @
4f5bec10
...
...
@@ -147,14 +147,14 @@ func UpdateNodeNew(c *gin.Context) {
return
}
t
,
err
:=
app
.
SafeCloseNode
()
if
err
!=
nil
||
!
t
{
//app.UpdateInfo.Flag = true
app
.
BityuanFlag
.
Flag
=
false
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
err
)
return
}
time
.
Sleep
(
time
.
Second
*
2
)
//
t, err := app.SafeCloseNode()
//
if err != nil || !t {
//
//app.UpdateInfo.Flag = true
//
app.BityuanFlag.Flag = false
//
appG.Response(http.StatusOK, e.NODE_ERROR, err)
//
return
//
}
//
time.Sleep(time.Second * 2)
remove
:=
exec
.
Command
(
"rm"
,
"-rf"
,
setting
.
BityuanSetting
.
Name
+
"_"
+
latestVersion
,
name
)
remove
.
Stderr
=
stderr
err
=
remove
.
Start
()
...
...
@@ -171,14 +171,16 @@ func UpdateNodeNew(c *gin.Context) {
app
.
BityuanFlag
.
Flag
=
false
return
}
err
=
app
.
StartProcess
(
setting
.
Chain33Pai
.
Auto
)
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
"fail to restart node"
)
tlog
.
Error
(
"UpdateNodeNew"
,
"auto.sh error "
,
err
)
//app.UpdateInfo.Flag = true
app
.
BityuanFlag
.
Flag
=
false
return
}
// err = app.StartProcess(setting.Chain33Pai.Auto)
// if err != nil {
// appG.Response(http.StatusOK, e.NODE_ERROR, "fail to restart node")
// tlog.Error("UpdateNodeNew", "auto.sh error ", err)
// //app.UpdateInfo.Flag = true
// app.BityuanFlag.Flag = false
// return
// }
util
.
AddValue
(
&
app
.
JobID
,
1
)
app
.
JobChan
<-
app
.
MsgType
{
Name
:
"RESTART"
,
JobID
:
app
.
JobID
}
app
.
BityuanFlag
.
Flag
=
false
//app.UpdateInfo.Flag = true
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
"update job ok"
)
...
...
Write
Preview
Markdown
is supported
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