Skip to content

Commit

Permalink
[WIP] Add TravisBranchMonitor
Browse files Browse the repository at this point in the history
Worker that is in charge of monitoring Travis for build_failures, and
will create BuildFailure records and send messages to gitter as needed.
  • Loading branch information
NickLaMuro committed Jan 14, 2020
1 parent e8bd93b commit b5e0a68
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions app/workers/travis_branch_monitor.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b5e0a68

Please sign in to comment.