Sha256: 36d09e9a2ee5760de86b6cb8924a0b0e5d0e9c576c5a5f08944316931b72343d

Contents?: true

Size: 1.29 KB

Versions: 43

Compression:

Stored size: 1.29 KB

Contents

# encoding: utf-8
module Mutx
  module Results

    def self.all_results_for task_id
      Mutx::Database::MongoConnector.results_for task_id
    end

    def self.results_ids_for task_id
      all_results_for(task_id).map do |result|
        result["_id"]
      end
    end

    def self.running_results_for_task_id task_id
      Mutx::Database::MongoConnector.running_results_for_task_id task_id
    end

    def self.all_results_ids
      Mutx::Database::MongoConnector.all_results_ids
    end

    def self.find_for key
      Mutx::Database::MongoConnector.find_results_for_key key
    end

    def self.find_for_status status
      Mutx::Database::MongoConnector.find_results_for_status status
    end

    def self.find_for_task task_name
      Mutx::Database::MongoConnector.find_results_for_task task_name
    end

    def self.all_results
      Mutx::Database::MongoConnector.all_results
    end

    def self.find_all_for_key key
      Mutx::Database::MongoConnector.find_results_for_key key
    end

    # Resets all results with running status
    def self.reset!
      Mutx::Database::MongoConnector.running_results.each do |result|
        Mutx::Support::Processes.kill_p(result["pid"]) if result["pid"]
        res = Mutx::Results::Result.get(result["_id"])
        res.reset!
      end
    end

  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
mutx-0.1.49 lib/mutx/results/results.rb
mutx-0.1.48 lib/mutx/results/results.rb
mutx-0.1.47 lib/mutx/results/results.rb
mutx-0.1.46 lib/mutx/results/results.rb
mutx-0.1.45 lib/mutx/results/results.rb
mutx-0.1.44 lib/mutx/results/results.rb
mutx-0.1.43 lib/mutx/results/results.rb
mutx-0.1.42 lib/mutx/results/results.rb
mutx-0.1.40 lib/mutx/results/results.rb
mutx-0.1.39 lib/mutx/results/results.rb
mutx-0.1.38 lib/mutx/results/results.rb
mutx-0.1.37 lib/mutx/results/results.rb
mutx-0.1.36 lib/mutx/results/results.rb
mutx-0.1.35 lib/mutx/results/results.rb
mutx-0.1.34 lib/mutx/results/results.rb
mutx-0.1.33 lib/mutx/results/results.rb
mutx-0.1.32 lib/mutx/results/results.rb
mutx-0.1.31 lib/mutx/results/results.rb
mutx-0.1.30 lib/mutx/results/results.rb
mutx-0.1.29 lib/mutx/results/results.rb