travis-api/lib/travis/api/workers/build_cancellation.rb
Tyranja 057e9f0379 add Sidekiq for cancelling build
:
add require sidekiq to the sidekiq.rb

update Gemfile.lock

bump travis-sidekiqs

correct require statement

fix another request

connect to the database

add current user

add current user correctly

add current user correctly

add puts to see were in the condition we are

missing invertted comma

add comments to the worker

I HAVE NO IDEA

Revert "I HAVE NO IDEA"

This reverts commit 8bd1259bf4ea1b479f9391847a4700b7b15efe57.

change the id and source to symbols in the params because siedekiq expects that

add more printout

setup database connection, metrics and notification

correct the test
2015-01-23 14:43:54 +01:00

24 lines
550 B
Ruby

require 'sidekiq/worker'
require 'multi_json'
module Travis
module Sidekiq
class BuildCancellation
class ProcessingError < StandardError; end
include ::Sidekiq::Worker
sidekiq_options queue: :build_cancellations
def perform(data)
p "#######################"
p data
user = User.find(data['user_id'])
test = { id: data['id'], source: data['source'] }
p test
Travis.service(:cancel_build, user, { id: data['id'], source: data['source'] }).run
end
end
end
end