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
2cf47178
Commit
2cf47178
authored
Aug 09, 2021
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d90cc5f8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
app.ini
conf/app.ini
+1
-1
process.go
pkg/app/process.go
+17
-1
No files found.
conf/app.ini
View file @
2cf47178
...
@@ -66,7 +66,7 @@ IdleTimeout = 200
...
@@ -66,7 +66,7 @@ IdleTimeout = 200
Name
=
v7-bityuan
Name
=
v7-bityuan
Path
=
/media/pi/bityuan/
Path
=
/media/pi/bityuan/
GitPath
=
https://github.com/bityuan/bityuan.git
GitPath
=
https://github.com/bityuan/bityuan.git
Passwd
=
/home/pi/p
asswd
Passwd
=
/home/pi/p
ss
VersionPath
=
https://raw.githubusercontent.com/bityuan/bityuan/master/bityuan.go
VersionPath
=
https://raw.githubusercontent.com/bityuan/bityuan/master/bityuan.go
[chain33-pai]
[chain33-pai]
...
...
pkg/app/process.go
View file @
2cf47178
...
@@ -456,7 +456,8 @@ func PaiJob(tick *time.Ticker) {
...
@@ -456,7 +456,8 @@ func PaiJob(tick *time.Ticker) {
select
{
select
{
case
<-
tick
.
C
:
case
<-
tick
.
C
:
AutoUpdate
()
AutoUpdate
()
AutoSSHClean
()
//AutoSSHClean()
RemoveOldPwdFile
()
AutoLogsClean
()
AutoLogsClean
()
}
}
}
}
...
@@ -468,6 +469,21 @@ type PaiProcessInfo struct {
...
@@ -468,6 +469,21 @@ type PaiProcessInfo struct {
Cmd
string
Cmd
string
}
}
func
RemoveOldPwdFile
()
error
{
_
,
err
:=
os
.
Stat
(
"/home/pi/passwd"
)
if
err
==
nil
{
err
=
os
.
Remove
(
"/home/pi/passwd"
)
if
err
!=
nil
{
tlog
.
Error
(
"remove old file"
,
"err"
,
err
)
return
err
}
}
if
os
.
IsNotExist
(
err
)
{
return
nil
}
return
nil
}
func
AutoLogsClean
()
error
{
func
AutoLogsClean
()
error
{
var
buf
bytes
.
Buffer
var
buf
bytes
.
Buffer
cmd
:=
exec
.
Command
(
"du"
,
"-m"
,
"chain33.out"
)
cmd
:=
exec
.
Command
(
"du"
,
"-m"
,
"chain33.out"
)
...
...
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