que-view 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/que/view/dsl.rb +20 -3
- data/lib/que/view/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca1165b499081e6a124caf37e168c75bd7e74d79c6cd7d4e6445925b9c32589e
|
4
|
+
data.tar.gz: e844c8f96e9eb7021124bb8e420302629805637fa0af9caef16d1b5aad5b03a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0256e1fce181ec2ff9864bbe1e9b90deff9191cd0421415ebf077445683bd23b1f9a2418bfb5f582c4a679c2c0509fe478b644e4f561fbf6f1936be27c5abae
|
7
|
+
data.tar.gz: ca009f6f1c8b8af5bfb9963daef9c32eaead6120b0558eb37542dd5a49845ffe9faeebf97ae6594e5023f171346858c9ed869cc214db56a3ac74979e63456521
|
data/lib/que/view/dsl.rb
CHANGED
@@ -163,10 +163,17 @@ module Que
|
|
163
163
|
|
164
164
|
def fetch_job_names_sql(queue_name)
|
165
165
|
<<-SQL.squish
|
166
|
-
SELECT COUNT(*) AS count_all,
|
166
|
+
SELECT COUNT(*) AS count_all,
|
167
|
+
CASE
|
168
|
+
WHEN job_class = 'ActiveJob::QueueAdapters::QueAdapter::JobWrapper' THEN args #>> '{0, job_class}'
|
169
|
+
ELSE job_class
|
170
|
+
END AS job_name
|
167
171
|
FROM que_jobs
|
168
172
|
#{queue_name.present? ? "WHERE queue = '#{queue_name}'" : ""}
|
169
|
-
GROUP BY
|
173
|
+
GROUP BY CASE
|
174
|
+
WHEN job_class = 'ActiveJob::QueueAdapters::QueAdapter::JobWrapper' THEN args #>> '{0, job_class}'
|
175
|
+
ELSE job_class
|
176
|
+
END
|
170
177
|
SQL
|
171
178
|
end
|
172
179
|
|
@@ -208,7 +215,17 @@ module Que
|
|
208
215
|
def search_condition(params)
|
209
216
|
result = ''
|
210
217
|
result += "AND queue = '#{params[:queue_name]}'" if params[:queue_name].present?
|
211
|
-
|
218
|
+
if params[:job_name].present?
|
219
|
+
result += <<~SQL
|
220
|
+
AND (
|
221
|
+
job_class = '#{params[:job_name]}'
|
222
|
+
OR (
|
223
|
+
job_class = 'ActiveJob::QueueAdapters::QueAdapter::JobWrapper'
|
224
|
+
AND args #>> '{0, job_class}' = '#{params[:job_name]}'
|
225
|
+
)
|
226
|
+
)
|
227
|
+
SQL
|
228
|
+
end
|
212
229
|
result
|
213
230
|
end
|
214
231
|
|
data/lib/que/view/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: que-view
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdanov Anton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: que
|