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
61060654
Commit
61060654
authored
Apr 08, 2020
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉自动升级节点 改为手动升级
parent
0ce8994f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
process.go
pkg/app/process.go
+1
-1
node.go
routers/api/v1/node.go
+15
-15
No files found.
pkg/app/process.go
View file @
61060654
...
@@ -170,7 +170,7 @@ func CornProcessJob(ticker *time.Ticker){
...
@@ -170,7 +170,7 @@ func CornProcessJob(ticker *time.Ticker){
}
}
//升级6.4.0bityuan
//升级6.4.0bityuan
updateBityuan640
()
//
updateBityuan640()
}
}
}
}
}
}
...
...
routers/api/v1/node.go
View file @
61060654
...
@@ -82,7 +82,7 @@ func UpdateNodeNew(c *gin.Context){
...
@@ -82,7 +82,7 @@ func UpdateNodeNew(c *gin.Context){
}
}
pwd
=
pwd
+
"/"
pwd
=
pwd
+
"/"
app
.
BityuanFlag
=
true
app
.
BityuanFlag
=
true
app
.
UpdateInfo
.
Flag
=
false
//
app.UpdateInfo.Flag = false
setting
.
FreshVersion
()
setting
.
FreshVersion
()
var
pai
pai_service
.
Pai
var
pai
pai_service
.
Pai
...
@@ -90,18 +90,18 @@ func UpdateNodeNew(c *gin.Context){
...
@@ -90,18 +90,18 @@ func UpdateNodeNew(c *gin.Context){
if
err
!=
nil
{
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
"get online version err"
)
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
"get online version err"
)
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
return
return
}
}
if
latestVersion
==
setting
.
BityuanSetting
.
Version
{
if
latestVersion
==
setting
.
BityuanSetting
.
Version
{
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
"current version is latest"
)
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
"current version is latest"
)
return
return
}
}
if
latestVersion
==
""
{
if
latestVersion
==
""
{
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
appG
.
Response
(
http
.
StatusOK
,
e
.
NETWORK_ERROR
,
"network error,please checkout your network then try again"
)
appG
.
Response
(
http
.
StatusOK
,
e
.
NETWORK_ERROR
,
"network error,please checkout your network then try again"
)
return
return
...
@@ -114,14 +114,14 @@ func UpdateNodeNew(c *gin.Context){
...
@@ -114,14 +114,14 @@ func UpdateNodeNew(c *gin.Context){
err
=
app
.
DownLoadFile
(
url
,
name
,
int32
(
1
))
err
=
app
.
DownLoadFile
(
url
,
name
,
int32
(
1
))
if
err
!=
nil
{
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
DOWNLOAD_ERROR
,
err
)
appG
.
Response
(
http
.
StatusOK
,
e
.
DOWNLOAD_ERROR
,
err
)
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
return
return
}
}
dirs
:=
strings
.
Split
(
absPath
,
"wallet-bty"
)
dirs
:=
strings
.
Split
(
absPath
,
"wallet-bty"
)
if
len
(
dirs
)
!=
2
{
if
len
(
dirs
)
!=
2
{
appG
.
Response
(
http
.
StatusOK
,
e
.
ERROR
,
err
)
appG
.
Response
(
http
.
StatusOK
,
e
.
ERROR
,
err
)
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
return
return
}
}
...
@@ -132,7 +132,7 @@ func UpdateNodeNew(c *gin.Context){
...
@@ -132,7 +132,7 @@ func UpdateNodeNew(c *gin.Context){
if
err
!=
nil
{
if
err
!=
nil
{
tlog
.
Error
(
"tar"
,
"err"
,
err
)
tlog
.
Error
(
"tar"
,
"err"
,
err
)
appG
.
Response
(
http
.
StatusOK
,
e
.
TAR_XVF_ERROR
,
err
)
appG
.
Response
(
http
.
StatusOK
,
e
.
TAR_XVF_ERROR
,
err
)
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
return
return
}
}
...
@@ -140,32 +140,32 @@ func UpdateNodeNew(c *gin.Context){
...
@@ -140,32 +140,32 @@ func UpdateNodeNew(c *gin.Context){
if
err
!=
nil
{
if
err
!=
nil
{
tlog
.
Error
(
"tar"
,
"err"
,
stderr
.
String
())
tlog
.
Error
(
"tar"
,
"err"
,
stderr
.
String
())
appG
.
Response
(
http
.
StatusOK
,
e
.
TAR_XVF_ERROR
,
stderr
.
String
())
appG
.
Response
(
http
.
StatusOK
,
e
.
TAR_XVF_ERROR
,
stderr
.
String
())
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
return
return
}
}
t
,
err
:=
app
.
SafeCloseNode
()
t
,
err
:=
app
.
SafeCloseNode
()
if
err
!=
nil
||
!
t
{
if
err
!=
nil
||
!
t
{
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
err
)
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
err
)
return
return
}
}
time
.
Sleep
(
time
.
Second
*
2
)
remove
:=
exec
.
Command
(
"rm"
,
"-rf"
,
setting
.
BityuanSetting
.
Name
+
"_"
+
latestVersion
,
name
)
remove
:=
exec
.
Command
(
"rm"
,
"-rf"
,
setting
.
BityuanSetting
.
Name
+
"_"
+
latestVersion
,
name
)
remove
.
Stderr
=
stderr
remove
.
Stderr
=
stderr
err
=
remove
.
Start
()
err
=
remove
.
Start
()
if
err
!=
nil
{
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
RM_ERROR
,
err
)
appG
.
Response
(
http
.
StatusOK
,
e
.
RM_ERROR
,
err
)
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
return
return
}
}
err
=
remove
.
Wait
()
err
=
remove
.
Wait
()
if
err
!=
nil
{
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
RM_ERROR
,
stderr
.
String
())
appG
.
Response
(
http
.
StatusOK
,
e
.
RM_ERROR
,
stderr
.
String
())
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
return
return
}
}
...
@@ -173,13 +173,13 @@ func UpdateNodeNew(c *gin.Context){
...
@@ -173,13 +173,13 @@ func UpdateNodeNew(c *gin.Context){
if
err
!=
nil
{
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
"fail to restart node"
)
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
"fail to restart node"
)
tlog
.
Error
(
"UpdateNodeNew"
,
"auto.sh error "
,
err
)
tlog
.
Error
(
"UpdateNodeNew"
,
"auto.sh error "
,
err
)
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
return
return
}
}
app
.
BityuanFlag
=
false
app
.
BityuanFlag
=
false
app
.
UpdateInfo
.
Flag
=
true
//
app.UpdateInfo.Flag = true
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
"update job
started
"
)
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
"update job
ok
"
)
}
}
//重置节点只需要删除datadir 然后重启节点
//重置节点只需要删除datadir 然后重启节点
...
...
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