Skip to content

Instantly share code, notes, and snippets.

@xfyuan
xfyuan / gist:a290fbd885af75fba742b4267a1ea23d
Last active February 16, 2022 07:59
Create GitLab Merge Request from terminal
We couldn’t find that file to show.
@xfyuan
xfyuan / kill_sidekiq_job.rb
Created March 29, 2022 03:58 — forked from Chocksy/kill_sidekiq_job.rb
Kill sidekiq jobs by process id for busy jobs and by jid for other sets.
# FOR BUSY JOBS
# take the process_id from the /busy page in sidekiq and kill the longest running one.
workers = Sidekiq::Workers.new
workers.each do |process_id, thread_id, work|
process = Sidekiq::Process.new('identity' => process_id)
process.stop! if process_id == 'integration.3:4:71d1d7f4ef5a'
end
# FOR SCHEDULED JOBS
# you need to know the jid to make this happen