fix git job again
This commit is contained in:
parent
6516a9df57
commit
e99bdc9906
|
@ -7,9 +7,9 @@ class GitJob < ApplicationJob
|
|||
|
||||
good_job_control_concurrency_with(perform_limit: 1)
|
||||
|
||||
def perform(identifier, *commands)
|
||||
def perform(identifier, base_path, *commands)
|
||||
commands.each do |command|
|
||||
system!(command)
|
||||
system!(command, path: base_path)
|
||||
end
|
||||
rescue StandardError => e
|
||||
ExceptionLog.add(e, source: "GitJob", identifier: identifier)
|
||||
|
@ -18,7 +18,7 @@ class GitJob < ApplicationJob
|
|||
|
||||
private
|
||||
|
||||
def system!(*)
|
||||
system(*, exception: true, chdir: Websites.config.yiffy2_storage.base_path)
|
||||
def system!(*, path:)
|
||||
system(*, exception: true, chdir: path)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,13 +5,13 @@ module StorageManager
|
|||
def delete(path)
|
||||
return unless exists?(path)
|
||||
super
|
||||
GitJob.perform_later("#{base_path}#{path}", "git add #{base_path}#{path}", "git commit -m \"Remove #{path[1..]}\"", "git push")
|
||||
GitJob.perform_later("#{base_path}#{path}", base_path, "git add #{base_path}#{path}", "git commit -m \"Remove #{path[1..]}\"", "git push")
|
||||
end
|
||||
|
||||
def put(path, io)
|
||||
super
|
||||
if exists?(path) # rubocop:disable Style/IfUnlessModifier
|
||||
GitJob.perform_later("#{base_path}#{path}", "git add #{base_path}#{path}", "git commit -m \"Add #{path[1..]}\"", "git push")
|
||||
GitJob.perform_later("#{base_path}#{path}", base_path, "git add #{base_path}#{path}", "git commit -m \"Add #{path[1..]}\"", "git push")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user