def select_by_jobs_count(proxies)
      exclude = @tasks.keys + @offline
      @tasks.merge!(get_counts(proxies - exclude))
      next_proxy = @tasks.select { |proxy, _| proxies.include?(proxy) }
                         .min_by { |_, job_count| job_count }.try(:first)
      @tasks[next_proxy] += 1 if next_proxy.present?
      next_proxy
    end
def select_by_jobs_count(proxies)
      exclude = @tasks.keys + @offline
      @tasks.merge!(get_counts(proxies - exclude))
      next_proxy = @tasks.select { |proxy, _| proxies.include?(proxy) }
                         .min_by { |_, job_count| job_count }.try(:first)
      @tasks[next_proxy] += 1 if next_proxy.present?
      next_proxy
    end
def select_by_jobs_count ( proxies ) exclude = @tasks . keys + @offline @tasks . merge! ( get_counts ( proxies - exclude ) ) next_proxy = @tasks . select { | proxy , _ | proxies . include? ( proxy ) } . min_by { | _ , job_count | job_count } . try ( :first ) @tasks [ next_proxy ] += 1 if next_proxy . present? next_proxy end
Get the least loaded proxy from the given list of proxies
Get the least loaded proxy from the given list of proxies