Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
a88e68ba
Commit
a88e68ba
authored
Aug 31, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了restart_process参数
parent
c00441ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
utils.py
utils.py
+7
-7
No files found.
utils.py
View file @
a88e68ba
...
...
@@ -80,21 +80,21 @@ def move_file():
def
restart_process
():
out
=
os
.
popen
(
"ps aux | grep diary
QueueUpdat
e.py"
)
.
read
()
out
=
os
.
popen
(
"ps aux | grep diary
UpdateOnlineOfflin
e.py"
)
.
read
()
for
line
in
out
.
splitlines
():
if
'python diary
QueueUpdat
e.py'
in
line
:
if
'python diary
UpdateOnlineOfflin
e.py'
in
line
:
pid
=
int
(
line
.
split
()[
1
])
# 有些进程的生命周期非常短或者随时可能结束,一定要捕捉这个异常
try
:
os
.
kill
(
pid
,
signal
.
SIGKILL
)
print
(
"已杀死python diary
QueueUpdat
e.py 进程"
)
print
(
"已杀死python diary
UpdateOnlineOfflin
e.py 进程"
)
except
OSError
:
print
(
'没有如此进程!!!'
)
os
.
popen
(
'python diary
QueueUpdat
e.py'
)
print
(
"成功重启diary
QueueUpdate
"
)
os
.
popen
(
'python diary
UpdateOnlineOfflin
e.py'
)
print
(
"成功重启diary
UpdateOnlineOffline.py
"
)
else
:
os
.
popen
(
'python diary
QueueUpdat
e.py'
)
print
(
"成功重启diary
QueueUpdate
"
)
os
.
popen
(
'python diary
UpdateOnlineOfflin
e.py'
)
print
(
"成功重启diary
UpdateOnlineOffline.py
"
)
# 把数据写到redis里
...
...
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