Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
91dce34f
Commit
91dce34f
authored
May 07, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be more graceful when terminating background processes
parent
352a4da5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
rakefiles/helpers.rb
+17
-7
No files found.
rakefiles/helpers.rb
View file @
91dce34f
...
...
@@ -37,18 +37,28 @@ def background_process(*command)
pgid
=
Process
.
getpgid
(
pid
)
begin
Timeout
.
timeout
(
5
)
do
puts
"
Termina
ting process group
#{
pgid
}
"
Process
.
kill
(
:SIG
TERM
,
-
pgid
)
puts
"
Interrup
ting process group
#{
pgid
}
"
Process
.
kill
(
:SIG
INT
,
-
pgid
)
puts
"Waiting on process group
#{
pgid
}
"
Process
.
wait
(
-
pgid
)
puts
"Done waiting on process group
#{
pgid
}
"
end
rescue
Timeout
::
Error
puts
"Killing process group
#{
pgid
}
"
Process
.
kill
(
:SIGKILL
,
-
pgid
)
puts
"Waiting on process group
#{
pgid
}
"
Process
.
wait
(
-
pgid
)
puts
"Done waiting on process group
#{
pgid
}
"
begin
Timeout
.
timeout
(
5
)
do
puts
"Terminating process group
#{
pgid
}
"
Process
.
kill
(
:SIGTERM
,
-
pgid
)
puts
"Waiting on process group
#{
pgid
}
"
Process
.
wait
(
-
pgid
)
puts
"Done waiting on process group
#{
pgid
}
"
end
rescue
Timeout
::
Error
puts
"Killing process group
#{
pgid
}
"
Process
.
kill
(
:SIGKILL
,
-
pgid
)
puts
"Waiting on process group
#{
pgid
}
"
Process
.
wait
(
-
pgid
)
puts
"Done waiting on process group
#{
pgid
}
"
end
end
end
end
...
...
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