Skip to content

Commit e3ae485

Browse files
authored
Merge pull request #17 from esminc/no-explicit-api-version
Stop specifying the explicit API version
2 parents 6944727 + 96a50ff commit e3ae485

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.0
2+
3+
Now the default Google::Cloud::Tasks client uses its default API version. Fixed #15.
4+
15
## 0.2.0
26

37
This version depends on google-cloud-tasks 2.0 or later. Since google-cloud-tasks 2.0 has API changes, upgrading to this version may affect to existing adapter initialization code. If you are initializing Google::Cloud::Tasks client manually, you will have to change `Google::Cloud::Tasks.new` to `Google::Cloud::Tasks.cloud_tasks` as follows:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Configure an adapter instance and pass it to Active Job:
2828
Rails.application.config.active_job.queue_adapter = ActiveJob::GoogleCloudTasks::HTTP::Adapter.new(
2929
project: 'a-gcp-project-name',
3030
location: 'asia-northeast1',
31-
url: 'https://an-endpoint-to-perform-jobs.a.run.app/_jobs',
32-
client: Google::Cloud::Tasks.cloud_tasks(version: :v2beta3), # optional
31+
url: 'https://hibariya.org/',
32+
client: Google::Cloud::Tasks.cloud_tasks, # optional
3333
task_options: { # optional
3434
oidc_token: {
3535
service_account_email: '[email protected]'
@@ -75,7 +75,7 @@ unless ARGV.include?("assets:precompile") # prevents running on assets:precompil
7575
project: 'my-project',
7676
location: 'europe-west2',
7777
url: 'https://www.example.com/jobs',
78-
client: Google::Cloud::Tasks.cloud_tasks(version: :v2beta3) { |config|
78+
client: Google::Cloud::Tasks.cloud_tasks { |config|
7979
# this will cause an error if the environment variable does not exist
8080
config.credentials = JSON.parse(ENV["GOOGLE_CLOUD_PRODUCTION_KEYFILE"])
8181
}

lib/active_job/google_cloud_tasks/http/adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def enqueue_at(job, scheduled_at)
3434
private
3535

3636
def client
37-
@client ||= Google::Cloud::Tasks.cloud_tasks(version: :v2beta3)
37+
@client ||= Google::Cloud::Tasks.cloud_tasks
3838
end
3939

4040
def build_task(job, attributes)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ActiveJob
22
module GoogleCloudTasks
33
module HTTP
4-
VERSION = "0.3.0"
4+
VERSION = "0.4.0"
55
end
66
end
77
end

0 commit comments

Comments
 (0)