diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-14 17:02:23 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-14 17:02:23 +0200 |
commit | 8bc8e7bc5e6598262a8aba20f064b83cd7c9f0a2 (patch) | |
tree | d5d6681bfafd71596a75cf5205abdf31424f0ca0 /lib/runner.rb | |
parent | 3169b900cc5005c88c7e6bdce0bdd36561978c01 (diff) | |
download | gitlab-ci-8bc8e7bc5e6598262a8aba20f064b83cd7c9f0a2.tar.gz |
Use faster sidekiq. Schedule is broken
Diffstat (limited to 'lib/runner.rb')
-rw-r--r-- | lib/runner.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/runner.rb b/lib/runner.rb index b546250..530ee3c 100644 --- a/lib/runner.rb +++ b/lib/runner.rb @@ -2,21 +2,25 @@ require 'open3' require 'timeout' class Runner + include Sidekiq::Worker + TIMEOUT = 1800 attr_accessor :project, :build, :output - @queue = :runner - def self.perform(build_id) - new(Build.find(build_id)).run + sidekiq_options queue: :runner + + def perform(build_id) + @build = Build.find(build_id) + @project = @build.project + + run end - def initialize(build) + def initialize @logger = Logger.new(STDOUT) @logger.level = Logger::INFO - @build = build - @project = build.project @output = '' end |