barbeque 2.3.0 → 2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66a4d253528f2a554ce38065c2eca4eb57f2281d6d6cbbe9adf285d00211b0b5
|
4
|
+
data.tar.gz: 3df5c3011aa375dce9274fffa75a8be6a77231632bba9fa02196a2c098447aa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e54454ba9b12c2dbb3bad474c8511e0b5234fb3296fd80679bcf0802470d46de47a118f7774fc5deb8d79c029d6d52c91b4bf8f2de1f9e25597e95e5dc6a60b1
|
7
|
+
data.tar.gz: f4e929ced516b5e0cec7e8d7e2db717f5b0b49d4ca3dc40bb37c211a57dc96dfbbe62d053afa1dbaa120fcb56a9bf5da288a65c74610f5d36ea6693d09278ecc
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'garage'
|
2
2
|
|
3
|
-
class Barbeque::Api::ApplicationController < ActionController::
|
3
|
+
class Barbeque::Api::ApplicationController < ActionController::API
|
4
|
+
before_action :force_json_format
|
5
|
+
|
4
6
|
include Garage::ControllerHelper
|
5
7
|
|
6
8
|
rescue_from ActiveRecord::RecordNotFound do |exception|
|
@@ -19,4 +21,9 @@ class Barbeque::Api::ApplicationController < ActionController::Base
|
|
19
21
|
def respond_with_error(status_code, error_code, message)
|
20
22
|
render json: { status_code: status_code, error_code: error_code, message: message }, status: status_code
|
21
23
|
end
|
24
|
+
|
25
|
+
# This is required to use ActionController::API with Garage
|
26
|
+
def force_json_format
|
27
|
+
request.format = :json
|
28
|
+
end
|
22
29
|
end
|
@@ -19,7 +19,7 @@ class Barbeque::JobDefinition < Barbeque::ApplicationRecord
|
|
19
19
|
from = from.beginning_of_hour
|
20
20
|
to = to.beginning_of_hour
|
21
21
|
stats = Hash.new { |h, k| h[k] = { count: 0, avg_time: 0 } }
|
22
|
-
job_executions.where(created_at: from .. to).group(DATE_HOUR_SQL).order(DATE_HOUR_SQL).pluck("#{DATE_HOUR_SQL}, count(1), avg(timestampdiff(second, created_at, finished_at))").each do |date_hour, count, avg_time|
|
22
|
+
job_executions.where(created_at: from .. to).group(DATE_HOUR_SQL).order(Arel.sql(DATE_HOUR_SQL)).pluck(Arel.sql("#{DATE_HOUR_SQL}, count(1), avg(timestampdiff(second, created_at, finished_at))")).each do |date_hour, count, avg_time|
|
23
23
|
time = Time.zone.parse("#{date_hour} UTC")
|
24
24
|
stats[time] = {
|
25
25
|
count: count,
|
data/lib/barbeque/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barbeque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: adminlte2-rails
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 5.
|
159
|
+
version: 5.2.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 5.
|
166
|
+
version: 5.2.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rinku
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -350,8 +350,6 @@ files:
|
|
350
350
|
- app/helpers/barbeque/application_helper.rb
|
351
351
|
- app/helpers/barbeque/job_definitions_helper.rb
|
352
352
|
- app/helpers/barbeque/job_executions_helper.rb
|
353
|
-
- app/jobs/barbeque/application_job.rb
|
354
|
-
- app/mailers/barbeque/application_mailer.rb
|
355
353
|
- app/models/barbeque/api/application_resource.rb
|
356
354
|
- app/models/barbeque/api/job_execution_resource.rb
|
357
355
|
- app/models/barbeque/api/job_retry_resource.rb
|