We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7a1a7b commit a7e3ae6Copy full SHA for a7e3ae6
app/models/solid_queue/batch_execution.rb
@@ -24,32 +24,9 @@ def create_all_from_jobs(jobs)
24
})
25
26
total = jobs.size
27
- SolidQueue::Batch.upsert(
28
- { batch_id:, total_jobs: total },
29
- **provider_upsert_options
30
- )
+ SolidQueue::Batch.where(batch_id:).update_all(["total_jobs = total_jobs + ?", total])
31
end
32
33
-
34
- private
35
36
- def provider_upsert_options
37
- case connection.adapter_name
38
- when "PostgreSQL", "SQLite"
39
- {
40
- unique_by: :batch_id,
41
- on_duplicate: Arel.sql(
42
- "total_jobs = solid_queue_batches.total_jobs + excluded.total_jobs"
43
44
- }
45
- else
46
47
48
- "total_jobs = total_jobs + VALUES(total_jobs)"
49
50
51
- end
52
53
54
55
0 commit comments