Skip to content

Commit

Permalink
chore(toys): Stop background processes using gen on_interrupt directive
Browse files Browse the repository at this point in the history
  • Loading branch information
aandreassa committed Aug 7, 2024
1 parent cb5d44f commit f0c94f0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shared/.toys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ def run
end
end
end
on_interrupt do
protoc_pids = `ps aux`.each_line.filter_map { |line| line.split[1].to_i if line.match?(/protoc-gen-ruby_/) }
puts "Terminating protoc-gen-ruby processes."
protoc_pids.each do |pid|
Process.kill("TERM", pid)
end
end

def run_gem_builder service, output_dir
require "gapic/gem_builder"
Expand Down

0 comments on commit f0c94f0

Please sign in to comment.