Skip to content

Commit

Permalink
increate timeout to 300s or go install can't finish
Browse files Browse the repository at this point in the history
  • Loading branch information
marguerite committed Apr 5, 2016
1 parent 45f4eb3 commit 6c37d31
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion golang/cli.rb
Expand Up @@ -21,8 +21,10 @@ def popen_env(hash, cmd)
# some commands need time, an immediate close
# will get a wrong status, so wait them with
# timeout 30s
# set timeout 300s, because go install takes
# lots of time sometimes
begin
Timeout.timeout(30) do
Timeout.timeout(300) do
@pipe = IO.popen(cmd)
Process.wait(@pipe.pid)
end
Expand All @@ -38,6 +40,8 @@ def popen_env(hash, cmd)

def self.run(env={},cmd="")

puts "GOPATH: #{env}"
puts "Command: #{cmd}"
unless RUBY_VERSION.to_f > 1.8
popen_env(env,cmd) {|f| f.each_line {|l| puts l}}
else
Expand Down

0 comments on commit 6c37d31

Please sign in to comment.