
See below for all the commit messages squashed into this one... add a test delete empty space add job_cancellation worker change id change job_id param add job restart worker add require to sidekiq.rb change params add test for job restart and cancellation add test for job restart update build.rb improve build spec update job restart with correct response, add test to chack for correct response when restarting job
20 lines
420 B
Ruby
20 lines
420 B
Ruby
require 'sidekiq/worker'
|
|
require 'multi_json'
|
|
|
|
module Travis
|
|
module Sidekiq
|
|
class JobCancellation
|
|
class ProcessingError < StandardError; end
|
|
|
|
include ::Sidekiq::Worker
|
|
sidekiq_options queue: :job_cancellations
|
|
|
|
def perform(data)
|
|
user = User.find(data['user_id'])
|
|
Travis.service(:cancel_job, user, { id: data['id'], source: data['source'] }).run
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|