Skip to content
Snippets Groups Projects
Commit 04a66a8d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Correctly hanlde build timeouts

parent d2a6a162
No related branches found
No related tags found
No related merge requests found
require 'open3'
require 'timeout'
class Runner
include Sidekiq::Worker
 
Loading
Loading
@@ -52,13 +49,6 @@ class Runner
end
 
build.success!
rescue Errno::ENOENT => ex
@output << "INVALID PROJECT PATH"
build.drop!
rescue Timeout::Error
@output << "TIMEOUT"
build.drop!
ensure
build.write_trace(@output)
end
Loading
Loading
@@ -97,7 +87,9 @@ class Runner
begin
@process.poll_for_exit(project.timeout)
rescue ChildProcess::TimeoutError
@output << "TIMEOUT"
@process.stop # tries increasingly harsher methods to kill the process.
return false
end
 
@process.exit_code == 0
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment