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
74e3e490
Commit
74e3e490
authored
Jun 02, 2020
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1ed582b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
raspberryChan.go
pkg/app/raspberryChan.go
+17
-3
No files found.
pkg/app/raspberryChan.go
View file @
74e3e490
...
...
@@ -134,7 +134,13 @@ func backup() error {
BityuanFlag
.
Flag
=
false
return
errors
.
New
(
"bty is running"
)
}
return
SafeBackup
()
err
=
SafeBackup
()
if
err
!=
nil
{
return
err
}
BityuanFlag
.
Flag
=
false
StartProcess
(
setting
.
Chain33Pai
.
Auto
)
return
nil
}
func
SafeBackup
()
error
{
...
...
@@ -145,7 +151,6 @@ func SafeBackup() error {
tlog
.
Error
(
"SafeBackup"
,
"err"
,
buf
.
String
())
return
err
}
BityuanFlag
.
Flag
=
false
return
nil
}
...
...
@@ -156,6 +161,14 @@ func recoverNode() error {
tlog
.
Error
(
"btyPath empty"
,
"err"
,
"node not exists"
)
return
errors
.
New
(
"node not exists"
)
}
_
,
err
:=
SafeCloseNode
()
if
err
!=
nil
{
return
err
}
isrun
:=
MakeSureBtyIsNotRun
()
if
isrun
{
return
errors
.
New
(
"bty is running"
)
}
backupPath
:=
btyPath
+
"/datadir_backup"
if
_
,
err
:=
os
.
Stat
(
backupPath
);
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
...
...
@@ -164,7 +177,7 @@ func recoverNode() error {
}
}
remove
:=
exec
.
Command
(
"rm"
,
"-rf"
,
btyPath
+
"/datadir"
)
err
:
=
remove
.
Run
()
err
=
remove
.
Run
()
if
err
!=
nil
{
tlog
.
Error
(
"rm -rf datadir"
,
"err"
,
err
)
return
err
...
...
@@ -176,6 +189,7 @@ func recoverNode() error {
tlog
.
Error
(
"cp -r datadir_backup datadir"
,
"err"
,
err
)
return
err
}
StartProcess
(
setting
.
Chain33Pai
.
Auto
)
return
nil
}
...
...
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