que-view 0.3.7 → 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: dac131f76f6eba41951dbf574850e81f64871d9416dddcb07bba66fc1633a3f3
4
- data.tar.gz: 6baf1c3c6b73672cdf7e5070d5c3b159ece6c40b830d7d2014554f4aa800fb1e
3
+ metadata.gz: 892e7e3d60cac8ff0d076575cb10454e88a2210f537d446bf8af5942f8ba945c
4
+ data.tar.gz: 92b8d7b993e6d9e6d7c572a144b63a8b00025e4ee9e28096f177f77bc41203f0
5
5
  SHA512:
6
- metadata.gz: 433f9452cea24393b5dcbd6517ce93386ac49fadd8cd209ddd80c952da7505a713672162458cd6ac146707410de04283ec08c60c92f6e6da70a896b11e78e45b
7
- data.tar.gz: 66cf2c86b57d6ecbc66e464e7a9afc6e02ce4bafd79d86b419c2e1cebb9eaf5769e1ce2cbae7827307593ec96c42bb015da5e61e8febc2016a0224a08e1c87f7
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.7'
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.7
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-07-30 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
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
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'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: rubocop-performance
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +150,48 @@ dependencies:
136
150
  - - "~>"
137
151
  - !ruby/object:Gem::Version
138
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'
139
195
  description: Rails engine as web interface for Que for inspecting jobs.
140
196
  email:
141
197
  - kortirso@gmail.com
@@ -159,6 +215,7 @@ files:
159
215
  - app/views/que/view/queue_metrics/index.html.erb
160
216
  - app/views/que/view/welcome/index.html.erb
161
217
  - config/routes.rb
218
+ - db/migrate/20240731072914_create_que_schema.rb
162
219
  - lib/que/view.rb
163
220
  - lib/que/view/configuration.rb
164
221
  - lib/que/view/dsl.rb