Sha256: 0c9a99699e3a13eebe32cb0dbb9ee7e73287b730a31b701359a6174fa5386f3a

Contents?: true

Size: 793 Bytes

Versions: 23

Compression:

Stored size: 793 Bytes

Contents

module Logical
  module Naf
    module JobStatuses
      class Queued

        def self.all(conditions)
          <<-SQL
            (
              SELECT DISTINCT
                j.*, jp."historical_job_id"
              FROM
                "#{::Naf.schema_name}"."historical_jobs" AS j
              LEFT JOIN
                "#{::Naf.schema_name}"."historical_job_prerequisites" AS jp
                ON j."id" = jp."historical_job_id"
              WHERE
                j.finished_at IS NULL AND
                j.request_to_terminate = false AND
                jp.historical_job_id IS NULL AND
                j.started_at IS NULL
              #{conditions}
              ORDER BY
                created_at desc
            )
          SQL
        end

      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
naf-1.1.2 app/models/logical/naf/job_statuses/queued.rb
naf-1.1.1 app/models/logical/naf/job_statuses/queued.rb
naf-1.1.0 app/models/logical/naf/job_statuses/queued.rb