rails-cloud-tasks 0.0.7 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/lib/rails_cloud_tasks/adapter.rb +2 -1
- data/lib/rails_cloud_tasks/credentials.rb +0 -1
- data/lib/rails_cloud_tasks/instrumentation/default.rb +2 -0
- data/lib/rails_cloud_tasks/instrumentation/new_relic.rb +4 -0
- data/lib/rails_cloud_tasks/instrumentation.rb +4 -0
- data/lib/rails_cloud_tasks/rack/jobs.rb +4 -0
- data/lib/rails_cloud_tasks/rack/tasks.rb +4 -0
- data/lib/rails_cloud_tasks/scheduler.rb +4 -3
- data/lib/rails_cloud_tasks/version.rb +1 -1
- data/rails-cloud-tasks.gemspec +4 -2
- metadata +6 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 952737c3d117251bc7512f2867fff43b13329baea58cefda03a1cbb202782b72
|
4
|
+
data.tar.gz: a341d110cce7e062c2b0102054f2afeaf5c407e262ed05f678119fac6917233b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7907df6e3c2ccf1dc053113b50e5a06f3b1051f2ec3ca6be6c1a788ae69d60b73b5034d3a8dba89136b5a606a870243f18667064a815fa926a1d9c3fce4cac6f
|
7
|
+
data.tar.gz: e06333fe3e9770248045a35dbc7f3749b1b853e13ade2470a3ad86a9ea6ba7e7e7a7d8a05a524c5c02c33f7240928e952cd84e4b570213e042735dfd2ad9b18a
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.7.
|
1
|
+
2.7.4
|
@@ -37,7 +37,8 @@ module RailsCloudTasks
|
|
37
37
|
http_request: {
|
38
38
|
http_method: :POST,
|
39
39
|
url: url,
|
40
|
-
body: { job: job.serialize }.to_json.force_encoding('ASCII-8BIT')
|
40
|
+
body: { job: job.serialize }.to_json.force_encoding('ASCII-8BIT'),
|
41
|
+
headers: { 'Content-Type': 'application/json' }
|
41
42
|
}.merge(auth),
|
42
43
|
schedule_time: timestamp && Google::Protobuf::Timestamp.new.tap do |ts|
|
43
44
|
ts.seconds = timestamp
|
@@ -15,6 +15,10 @@ module RailsCloudTasks
|
|
15
15
|
request = ::Rack::Request.new(env)
|
16
16
|
job_args = extract_args(request)
|
17
17
|
|
18
|
+
RailsCloudTasks::Instrumentation.add_custom_attributes(
|
19
|
+
{ request_body: job_args }
|
20
|
+
)
|
21
|
+
|
18
22
|
job_class.perform_now(*job_args)
|
19
23
|
|
20
24
|
response(200, {})
|
@@ -13,6 +13,10 @@ module RailsCloudTasks
|
|
13
13
|
"RailsCloudTasks/#{job['job_class']}/perform_now"
|
14
14
|
)
|
15
15
|
|
16
|
+
RailsCloudTasks::Instrumentation.add_custom_attributes(
|
17
|
+
{ request_body: job['arguments'] }
|
18
|
+
)
|
19
|
+
|
16
20
|
ActiveJob::Base.execute(job)
|
17
21
|
response(200, {})
|
18
22
|
rescue Rack::InvalidPayloadError => e
|
@@ -25,9 +25,10 @@ module RailsCloudTasks
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def client
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
configure = lambda { |client|
|
29
|
+
client.configure.credentials = credentials.generate(service_account_email)
|
30
|
+
}
|
31
|
+
@client ||= Google::Cloud::Scheduler.cloud_scheduler.tap(&configure)
|
31
32
|
end
|
32
33
|
|
33
34
|
protected
|
data/rails-cloud-tasks.gemspec
CHANGED
@@ -17,13 +17,12 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.required_ruby_version = '>= 2.
|
20
|
+
spec.required_ruby_version = '>= 2.7'
|
21
21
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
22
22
|
f.match(%r{^(test|spec|features)/})
|
23
23
|
end
|
24
24
|
|
25
25
|
spec.add_dependency 'activesupport', '>= 4'
|
26
|
-
spec.add_dependency 'google-apis-cloudscheduler_v1'
|
27
26
|
spec.add_dependency 'google-apis-iamcredentials_v1'
|
28
27
|
spec.add_dependency 'google-cloud-scheduler', '>= 2'
|
29
28
|
spec.add_dependency 'google-cloud-tasks', '>= 2'
|
@@ -41,4 +40,7 @@ Gem::Specification.new do |spec|
|
|
41
40
|
spec.add_development_dependency 'shoulda-matchers'
|
42
41
|
spec.add_development_dependency 'simplecov'
|
43
42
|
spec.add_development_dependency 'webmock'
|
43
|
+
spec.metadata = {
|
44
|
+
'rubygems_mfa_required' => 'true'
|
45
|
+
}
|
44
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-cloud-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Araújo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: google-apis-cloudscheduler_v1
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: google-apis-iamcredentials_v1
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -300,7 +286,8 @@ files:
|
|
300
286
|
homepage: http://github.com/flamingo-run/rails-cloud-tasks
|
301
287
|
licenses:
|
302
288
|
- Apache License 2.0
|
303
|
-
metadata:
|
289
|
+
metadata:
|
290
|
+
rubygems_mfa_required: 'true'
|
304
291
|
post_install_message:
|
305
292
|
rdoc_options: []
|
306
293
|
require_paths:
|
@@ -309,14 +296,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
309
296
|
requirements:
|
310
297
|
- - ">="
|
311
298
|
- !ruby/object:Gem::Version
|
312
|
-
version: '2.
|
299
|
+
version: '2.7'
|
313
300
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
301
|
requirements:
|
315
302
|
- - ">="
|
316
303
|
- !ruby/object:Gem::Version
|
317
304
|
version: '0'
|
318
305
|
requirements: []
|
319
|
-
rubygems_version: 3.1.
|
306
|
+
rubygems_version: 3.1.6
|
320
307
|
signing_key:
|
321
308
|
specification_version: 4
|
322
309
|
summary: Rails Cloud Tasks
|