From cab128f06e9ee159bb388cf7934ea17855cfc8fb Mon Sep 17 00:00:00 2001 From: carlad Date: Thu, 22 Jan 2015 11:10:27 +0100 Subject: [PATCH] refactor buildcancellation worker --- lib/travis/api/workers/build_cancellation.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/travis/api/workers/build_cancellation.rb b/lib/travis/api/workers/build_cancellation.rb index be19d31b..adecf1ec 100644 --- a/lib/travis/api/workers/build_cancellation.rb +++ b/lib/travis/api/workers/build_cancellation.rb @@ -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