lib/rocket_job/active_worker.rb in rocketjob-3.3.1 vs lib/rocket_job/active_worker.rb in rocketjob-3.3.2
- old
+ new
@@ -14,10 +14,10 @@
# server_name: [String]
# Only jobs running on the specified server
def self.all(server_name = nil)
servers = []
# Need paused, failed or aborted since servers may still be working on active slices
- query = RocketJob::Job.where(:state.in => [:running, :paused, :failed, :aborted])
+ query = RocketJob::Job.where(:state.in => [:running, :paused, :failed, :aborted])
query = query.where(worker_name: /\A#{server_name}/) if server_name
query.each do |job|
servers += job.rocket_job_active_workers
end
servers