refactor buildcancellation worker
This commit is contained in:
parent
39bd25cc3b
commit
cab128f06e
|
@ -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
|
# 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
|
sidekiq_options queue: build_cancellations
|
||||||
|
|
||||||
attr_accessor :data
|
|
||||||
|
|
||||||
def perform(data)
|
def perform(data)
|
||||||
@data = data
|
Travis.service(:cancel_build, data).run
|
||||||
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)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user