que-view 0.3.6 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b38c70a63ef216594de90e87f3efb291fc172f0cb6717b23c38c8befac12040
4
- data.tar.gz: 171c1cf26da0b93ef7cc455b28965d8e9ac4976ffd146ed257cd20d0129e9f29
3
+ metadata.gz: 892e7e3d60cac8ff0d076575cb10454e88a2210f537d446bf8af5942f8ba945c
4
+ data.tar.gz: 92b8d7b993e6d9e6d7c572a144b63a8b00025e4ee9e28096f177f77bc41203f0
5
5
  SHA512:
6
- metadata.gz: 5f1f6cb96fe426728dd3cbb08ed1089fb011d9aa626c28cb51fc64dd7d4a0c9a0ea2187fd9091c11b4b5dd0d95d93c24bb31fecb6e1a628bf073db443e47c40d
7
- data.tar.gz: 3c205d1ac845a36d14b4dfc76a8e8df025b1b8935c8bd2a6a78bee1c179ebd2249cb81f022332c63c29071107d17e51d4873e81a1b4d8adccef74ed84b91edae
6
+ metadata.gz: 6a67ca26a2c007d69be9bd7a036a726cc129bb083c9dd86671edd5aaa70882130158b2f8d7573574785b7523b3b2c2c06cad25bfb850e8d5d52dda694192e9eb
7
+ data.tar.gz: 7b9e498a11c818b8f8cb6d67ba1d816d5d3a4387147fb7ae33ca31dfb400fc51d00e974e1ccacb7683aff92da0090bd170909729809cc0255255d82d0f73d120
@@ -1,4 +1,4 @@
1
- <h1><%= params[:status].capitalize %> jobs</h1>
1
+ <h1><%= params[:status]&.capitalize %> jobs</h1>
2
2
  <%= form_with url: jobs_path, method: :get, class: 'search-form' do |form| %>
3
3
  <%= form.hidden_field :status, value: params[:status] %>
4
4
  <div class="row">
@@ -33,7 +33,7 @@
33
33
  <tr>
34
34
  <th>Args</th>
35
35
  <td>
36
- <% @job.dig(:args, 0, :arguments).each do |argument| %>
36
+ <% Array(@job.dig(:args, 0, :arguments)).each do |argument| %>
37
37
  <p><%= argument %></p>
38
38
  <% end %>
39
39
  </td>
@@ -0,0 +1,13 @@
1
+ class CreateQueSchema < ActiveRecord::Migration[7.1]
2
+ def up
3
+ # Whenever you use Que in a migration, always specify the version you're
4
+ # migrating to. If you're unsure what the current version is, check the
5
+ # changelog.
6
+ Que.migrate!(version: 7)
7
+ end
8
+
9
+ def down
10
+ # Migrate to version 0 to remove Que entirely.
11
+ Que.migrate!(version: 0)
12
+ end
13
+ end
data/lib/que/view/dsl.rb CHANGED
@@ -95,7 +95,7 @@ module Que
95
95
  SELECT count(*) AS total,
96
96
  count(locks.job_id) AS running,
97
97
  coalesce(sum((error_count > 0 AND locks.job_id IS NULL AND expired_at IS NULL)::int), 0) AS failing,
98
- coalesce(sum((error_count = 0 AND locks.job_id IS NULL)::int), 0) AS scheduled,
98
+ coalesce(sum((error_count = 0 AND locks.job_id IS NULL AND finished_at IS NULL AND expired_at IS NULL)::int), 0) AS scheduled,
99
99
  coalesce(sum((finished_at IS NOT NULL)::int), 0) AS finished,
100
100
  coalesce(sum((expired_at IS NOT NULL)::int), 0) AS expired
101
101
  FROM que_jobs
@@ -121,7 +121,7 @@ module Que
121
121
  WHEN expired_at IS NOT NULL THEN 'expired'
122
122
  WHEN finished_at IS NOT NULL THEN 'finished'
123
123
  WHEN locks.job_id IS NULL AND error_count > 0 AND expired_at IS NULL THEN 'failing'
124
- WHEN locks.job_id IS NULL AND error_count = 0 THEN 'scheduled'
124
+ WHEN locks.job_id IS NULL AND error_count = 0 AND finished_at IS NULL AND expired_at IS NULL THEN 'scheduled'
125
125
  ELSE 'running'
126
126
  END status
127
127
  FROM que_jobs
@@ -135,7 +135,7 @@ module Que
135
135
  WHEN expired_at IS NOT NULL THEN 'expired'
136
136
  WHEN finished_at IS NOT NULL THEN 'finished'
137
137
  WHEN locks.job_id IS NULL AND error_count > 0 AND expired_at IS NULL THEN 'failing'
138
- WHEN locks.job_id IS NULL AND error_count = 0 THEN 'scheduled'
138
+ WHEN locks.job_id IS NULL AND error_count = 0 AND finished_at IS NULL AND expired_at IS NULL THEN 'scheduled'
139
139
  ELSE 'running'
140
140
  END
141
141
  SQL
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Que
4
4
  module View
5
- VERSION = '0.3.6'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
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.3.6
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdanov Anton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-14 00:00:00.000000000 Z
11
+ date: 2024-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: que
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 6.0.0
41
- - !ruby/object:Gem::Dependency
42
- name: sassc-rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: bundler
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +108,20 @@ dependencies:
122
108
  - - "~>"
123
109
  - !ruby/object:Gem::Version
124
110
  version: '1.39'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-factory_bot
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rubocop-performance
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,48 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0.6'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '3.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '3.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-rspec_rails
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '2.0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '2.0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: sassc-rails
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
153
195
  description: Rails engine as web interface for Que for inspecting jobs.
154
196
  email:
155
197
  - kortirso@gmail.com
@@ -173,6 +215,7 @@ files:
173
215
  - app/views/que/view/queue_metrics/index.html.erb
174
216
  - app/views/que/view/welcome/index.html.erb
175
217
  - config/routes.rb
218
+ - db/migrate/20240731072914_create_que_schema.rb
176
219
  - lib/que/view.rb
177
220
  - lib/que/view/configuration.rb
178
221
  - lib/que/view/dsl.rb