Sha256: 976e2b99887dba7d2509908bd7d3858a527a9d60572024a8610f8f7178bfdc17
Contents?: true
Size: 1.43 KB
Versions: 23
Compression:
Stored size: 1.43 KB
Contents
module Logical module Naf module JobStatuses class Waiting 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 NOT NULL AND j.started_at is NULL AND EXISTS ( SELECT 1 FROM "#{::Naf.schema_name}"."historical_jobs" JOIN "#{::Naf.schema_name}"."historical_job_prerequisites" ON "#{::Naf.schema_name}"."historical_jobs"."id" = "#{::Naf.schema_name}"."historical_job_prerequisites"."prerequisite_historical_job_id" WHERE "#{::Naf.schema_name}"."historical_job_prerequisites"."historical_job_id" = jp."historical_job_id" AND "#{::Naf.schema_name}"."historical_jobs"."finished_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