21 lines
348 B
Ruby
21 lines
348 B
Ruby
# frozen_string_literal: true
|
|
|
|
class GitJob < ApplicationJob
|
|
queue_as :git
|
|
|
|
good_job_control_concurrency_with(perform_limit: 1)
|
|
|
|
# used for locking
|
|
def perform(_identifier, *commands)
|
|
commands.each do |command|
|
|
system!(command)
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def system!(*)
|
|
system(*, exception: true, chdir: base_path)
|
|
end
|
|
end
|