Skip to content

Commit

Permalink
Remove return value from sync_workers and friends
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Mar 13, 2024
1 parent a44f18c commit 7a3131a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions app/models/miq_server/worker_management/kubernetes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,11 @@ def sync_starting_workers
end

def sync_stopping_workers
stopping = MiqWorker.find_all_stopping.to_a

stopping.reject { |w| w.class.rails_worker? }.each do |worker|
MiqWorker.find_all_stopping.reject { |w| w.class.rails_worker? }.each do |worker|
next if get_pod(worker[:system_uid]).present?

worker.update!(:status => MiqWorker::STATUS_STOPPED)
stopping.delete(worker)
end

stopping
end

def enough_resource_to_start_worker?(_worker_class)
Expand Down
7 changes: 1 addition & 6 deletions app/models/miq_server/worker_management/systemd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,15 @@ def sync_starting_workers
end

def sync_stopping_workers
stopping = MiqWorker.find_all_stopping.to_a

sync_from_system

stopping.reject { |w| w.class.rails_worker? }.each do |worker|
MiqWorker.find_all_stopping.reject { |w| w.class.rails_worker? }.each do |worker|
# If the worker record is "stopping" and the systemd unit is gone then the
# worker has successfully exited.
next if miq_services_by_unit[worker[:system_uid]].present?

worker.update!(:status => MiqWorker::STATUS_STOPPED)
stopping.delete(worker)
end

stopping
end

def cleanup_failed_workers
Expand Down

0 comments on commit 7a3131a

Please sign in to comment.