Skip to content

Commit 7674f81

Browse files
committed
Give the worker process a title
Closes #242
1 parent db2aa4f commit 7674f81

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/spring/application.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def serve(client)
150150
trap("TERM", "DEFAULT")
151151

152152
ARGV.replace(args)
153+
$0 = command.process_title
153154

154155
# Delete all env vars which are unchanged from before spring started
155156
original_env.each { |k, v| ENV.delete k if ENV[k] == v }

lib/spring/command_wrapper.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ def call
3737
if command.respond_to?(:call)
3838
command.call
3939
else
40-
$0 = exec
4140
load exec
4241
end
4342
end
4443

44+
def process_title
45+
["spring", name, *ARGV].join(" ")
46+
end
47+
4548
def gem_name
4649
if command.respond_to?(:gem_name)
4750
command.gem_name

0 commit comments

Comments
 (0)