diff --git a/app/workers/travis_branch_monitor.rb b/app/workers/travis_branch_monitor.rb new file mode 100644 index 00000000..5b891dde --- /dev/null +++ b/app/workers/travis_branch_monitor.rb @@ -0,0 +1,29 @@ +require 'travis' + +class TravisBranchMonitor + include Sidekiq::Worker + sidekiq_options :queue => :miq_bot_glacial, :retry => false + + include Sidetiq::Schedulable + recurrence { hourly.minute_of_hour(0, 15, 30, 45) } + + include SidekiqWorkerMixin + + def perform + if !first_unique_worker? + logger.info "#{self.class} is already running, skipping" + else + process_repos + end + end + + def process_repos + enabled_repos.each { |repo| process_repo(repo) } + end + + def process_repo repo + end + + def process_branch branch + end +end