Skip to content

Commit

Permalink
1779 git push into a repository doesnt start jobs (#1782)
Browse files Browse the repository at this point in the history
* Push the job into the right redis-list.

* Fix error "unknown key: :user" at GitRepository#commits.
  • Loading branch information
eugenk committed Aug 14, 2016
1 parent 4e0724b commit 2007ce6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions git/lib/git_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
class GitUpdate

def self.update_redis(repo_path, oldrev, newrev, refname, key_id)
Subprocess.run 'redis-cli', 'rpush', "#{Settings.redis_namespace}:queue:default", {
class: 'RepositoryUpdateWorker',
args: [repo_path, oldrev, newrev, refname, key_id]
}.to_json
Subprocess.run 'redis-cli', 'rpush',
"#{Settings.redis_namespace}:sidekiq:queue:default",
{class: 'RepositoryUpdateWorker',
args: [repo_path, oldrev, newrev, refname, key_id]}.to_json
end

def initialize(repo_path, key_id, refs)
Expand Down
5 changes: 3 additions & 2 deletions lib/ontology_saver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def suspended_save_ontologies(options={})
versions = []
commits_count = 0
highest_change_file_count = 0
user = options.delete(:user)
repository.walk_commits(options) { |commit|
commits_count += 1
current_file_count = 0
Expand All @@ -43,15 +44,15 @@ def suspended_save_ontologies(options={})
mark_ontology_as_having_file(f.path, has_file: true)
ontology_version_options = OntologyVersionOptions.new(
f.path,
options.delete(:user),
user,
fast_parse: repository.has_changed?(f.path, commit.oid))
versions << save_ontology(commit.oid, ontology_version_options,
changed_files: changed_files,
do_parse: false)
elsif f.renamed?
ontology_version_options = OntologyVersionOptions.new(
f.path,
options.delete(:user),
user,
fast_parse: repository.has_changed?(f.path, commit.oid),
previous_filepath: f.delta.old_file[:path])
versions << save_ontology(commit.oid, ontology_version_options,
Expand Down

0 comments on commit 2007ce6

Please sign in to comment.