Skip to content

Commit

Permalink
Merge pull request #5571 from cfouant/task-status-jobs-elasticsearch
Browse files Browse the repository at this point in the history
Refs #11752 - removes task status and job from elasticsearch
  • Loading branch information
cfouant committed Nov 9, 2015
2 parents 1dbcb8e + e7cfb4d commit f310ae8
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 87 deletions.
23 changes: 0 additions & 23 deletions app/models/katello/glue/elastic_search/job.rb

This file was deleted.

52 changes: 0 additions & 52 deletions app/models/katello/glue/elastic_search/task_status.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/models/katello/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class Job < Katello::Model
self.include_root_in_json = false

include Glue
include Glue::ElasticSearch::Job if SETTINGS[:katello][:use_elasticsearch]

belongs_to :job_owner, :polymorphic => true

Expand Down Expand Up @@ -36,15 +35,9 @@ def refresh_for_owner(owner)

ids = tasks.select("#{task_status_table}.id").collect { |row| row[:id] }

# retrieve the jobs associated with those tasks
jobs = Job.where("#{task_status_table}.id" => ids).joins(:task_statuses)

# refresh the tasks via pulp
refresh_tasks(ids) unless ids.empty?

# update the elasticsearch index for the associated jobs
Job.index_import(jobs) unless jobs.empty?

# retrieve the jobs for the current owner (e.g. system group)
Job.where(:job_owner_id => owner.id, :job_owner_type => owner.class.name)
end
Expand Down
2 changes: 0 additions & 2 deletions app/models/katello/pulp_sync_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ def parse_generic(details, errors)

module Katello
class PulpSyncStatus < PulpTaskStatus
use_index_of TaskStatus if SETTINGS[:katello][:use_elasticsearch]

HISTORY_ERROR = 'failed'
HISTORY_SUCCESS = 'success'
FINISHED = "finished"
Expand Down
1 change: 0 additions & 1 deletion app/models/katello/pulp_task_status.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Katello
class PulpTaskStatus < TaskStatus
use_index_of TaskStatus if SETTINGS[:katello][:use_elasticsearch]
WAIT_TIMES = [0.5, 1, 2, 4, 8, 16]
WAIT_TIME_STEP = 5

Expand Down
2 changes: 0 additions & 2 deletions app/models/katello/task_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class Status
TIMED_OUT = :timed_out
end

include Glue::ElasticSearch::TaskStatus if SETTINGS[:katello][:use_elasticsearch]

belongs_to :organization, :inverse_of => :task_statuses, :class_name => "Organization"
belongs_to :user, :inverse_of => :task_statuses, :class_name => "::User"

Expand Down

0 comments on commit f310ae8

Please sign in to comment.