Class: SidekiqBatch::CompletionQuery
- Inherits:
-
Object
- Object
- SidekiqBatch::CompletionQuery
- Defined in:
- app/models/sidekiq_batch/completion_query.rb
Constant Summary collapse
- Policy =
::Sidekiq::Batch::Jobs::FailurePolicy
Class Method Summary collapse
-
.sql ⇒ String
SQL with one
?placeholder, for the batch id.
Class Method Details
.sql ⇒ String
Returns SQL with one ? placeholder, for the batch id.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/models/sidekiq_batch/completion_query.rb', line 9 def sql <<~SQL.squish UPDATE sidekiq_batches SET status = #{outcome}, completed_at = NOW(), updated_at = NOW() WHERE id = ? AND status = #{batch_status("running")} AND NOT EXISTS (#{jobs_with(job_status("pending"))}) RETURNING status SQL end |