refactor buildcancellation worker

This commit is contained in:
carlad 2015-01-22 11:10:27 +01:00
parent 39bd25cc3b
commit cab128f06e

View File

@ -10,19 +10,8 @@ module Travis
# do we need to name the queue here? we didn't do this in Admin. We passed this info in the procfile
sidekiq_options queue: build_cancellations
attr_accessor :data
def perform(data)
@data = data
if payload
service.run
else
Travis.logger.warn("The #{type} payload was empty and could not be processed")
end
end
def service
@service ||= Travis.service(:cancel_build, data)
Travis.service(:cancel_build, data).run
end
end
end