Skip to content

Commit

Permalink
#800 fix async job problem with arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Oct 21, 2021
1 parent 8ae7a10 commit 89401e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/workers/githosting_shell_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ class GithostingShellWorker

sidekiq_options queue: :redmine_git_hosting, retry: false

def self.maybe_do(command, object, **options)
def self.maybe_do(command, object, options)
args = [command.to_s, object, options]
Sidekiq::Queue.new(:redmine_git_hosting).each do |job|
return if job.args == args
return nil if job.args == args
end

perform_async command, object, options
end

def perform(command, object, **options)
def perform(command, object, options)
logger.info "#{command} | #{object} | #{options}"
RedmineGitHosting::GitoliteWrapper.resync_gitolite command, object, options
end
Expand Down
4 changes: 2 additions & 2 deletions lib/redmine_git_hosting/gitolite_accessor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def resync_gitolite(command, object, **options)

if RedmineGitHosting::Config.gitolite_use_sidekiq? &&
RedmineGitHosting::Config.sidekiq_available? && !bypass
GithostingShellWorker.maybe_do command, object, **options
GithostingShellWorker.maybe_do command, object, options
else
GitoliteWrapper.resync_gitolite command, object, **options
GitoliteWrapper.resync_gitolite command, object, options
end
end
end
Expand Down

0 comments on commit 89401e8

Please sign in to comment.