rails-cloud-tasks 0.0.6 → 0.0.7.pre.rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_cloud_tasks/adapter.rb +4 -6
- data/lib/rails_cloud_tasks/scheduler.rb +8 -6
- data/lib/rails_cloud_tasks/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 608be671dc67ea087a4cb6dd7ac3b084b0f28ce0f2844da2922763d847e5a24c
|
4
|
+
data.tar.gz: a94fde11198f650c59026ba94bf4d6e16cb53f36881f49bbceb8590f1cbb0249
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7804b19ada7acf909b5c747ad5dfb7618951c5e3f07f007298b9e7d3c4a1b279c5184e98373fce0f93ba028b642fa9d63b6b989439fcc1cfc036dc188e2f3998
|
7
|
+
data.tar.gz: 7566756661ca56eed8c8adf89838df7ce4d8e4c37087efe3eb697323e71eb04e17464d1dda6436e9b57dd509f5b2761434140b33b6f71808981146417b59754e
|
@@ -2,14 +2,8 @@ require 'google-cloud-tasks'
|
|
2
2
|
|
3
3
|
module RailsCloudTasks
|
4
4
|
class Adapter
|
5
|
-
attr_reader :client
|
6
|
-
|
7
5
|
delegate :project_id, :location_id, :host, :tasks_path, :auth, to: 'RailsCloudTasks.config'
|
8
6
|
|
9
|
-
def initialize(client = Google::Cloud::Tasks.cloud_tasks)
|
10
|
-
@client = client
|
11
|
-
end
|
12
|
-
|
13
7
|
def enqueue(job, timestamp = nil)
|
14
8
|
path = client.queue_path(project: project_id, location: location_id, queue: job.queue_name)
|
15
9
|
task = build_task(job, timestamp)
|
@@ -28,6 +22,10 @@ module RailsCloudTasks
|
|
28
22
|
enqueue(job, timestamp.to_i)
|
29
23
|
end
|
30
24
|
|
25
|
+
def client
|
26
|
+
@client ||= Google::Cloud::Tasks.cloud_tasks
|
27
|
+
end
|
28
|
+
|
31
29
|
private
|
32
30
|
|
33
31
|
def url
|
@@ -4,17 +4,13 @@ module RailsCloudTasks
|
|
4
4
|
:scheduler_file_path, :scheduler_prefix_name,
|
5
5
|
:service_account_email, to: 'RailsCloudTasks.config'
|
6
6
|
|
7
|
-
attr_reader :
|
7
|
+
attr_reader :credentials, :logger
|
8
8
|
|
9
9
|
def initialize(
|
10
|
-
client: Google::Cloud::Scheduler.cloud_scheduler,
|
11
10
|
credentials: RailsCloudTasks::Credentials.new,
|
12
11
|
logger: RailsCloudTasks.logger
|
13
12
|
)
|
14
|
-
|
15
|
-
config.credentials = credentials.generate(service_account_email)
|
16
|
-
end
|
17
|
-
@client = client
|
13
|
+
@credentials = credentials
|
18
14
|
@logger = logger
|
19
15
|
end
|
20
16
|
|
@@ -28,6 +24,12 @@ module RailsCloudTasks
|
|
28
24
|
log_output(result)
|
29
25
|
end
|
30
26
|
|
27
|
+
def client
|
28
|
+
@client ||= Google::Cloud::Scheduler.cloud_scheduler.configure do |config|
|
29
|
+
config.credentials = credentials.generate(service_account_email)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
31
33
|
protected
|
32
34
|
|
33
35
|
def location_path
|
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.7.pre.rc
|
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-03-
|
11
|
+
date: 2021-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -312,9 +312,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
312
312
|
version: '2.4'
|
313
313
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
314
|
requirements:
|
315
|
-
- - "
|
315
|
+
- - ">"
|
316
316
|
- !ruby/object:Gem::Version
|
317
|
-
version:
|
317
|
+
version: 1.3.1
|
318
318
|
requirements: []
|
319
319
|
rubygems_version: 3.1.4
|
320
320
|
signing_key:
|