activejob-google_cloud_tasks-http icon indicating copy to clipboard operation
activejob-google_cloud_tasks-http copied to clipboard

Stop specifying the explicit API version

Open hibariya opened this issue 6 months ago • 2 comments

Fixes https://github.com/esminc/activejob-google_cloud_tasks-http/issues/15

As @koic suggested in the issue, I removed the fixed version parameter since it's doesn't make sense today and hard to maintain.

I also confirmed enqueue is working after the change by running the following code just in case:

# The env var GOOGLE_APPLICATION_CREDENTIALS ponts the necessary keyfile
adapter = ActiveJob::GoogleCloudTasks::HTTP::Adapter.new(
  project: 'delta-petra',
  location: 'asia-northeast1',
  url: 'https://hibariya.org/', # will get 404 tho
)

class TestJob
  def serialize = {}
  def queue_name = 'test-queue'
end

adapter.enqueue(TestJob.new)
# => <Google::Cloud::Tasks::V2::Task: name: "projects/delta-petra/locations/asia-northeast1/queues/test-queue/tasks/43981710605354104261", http_request: <Google::Cloud::Tasks::V2::HttpRequest: url: "https://hibariya.org/", http_method: :POST, headers: {"User-Agent"=>"Google-Cloud-Tasks", "Content-Type"=>"application/json"}, body: "">, schedule_time: <Google::Protobuf::Timestamp: seconds: 1744329215, nanos: 673695000>, create_time: <Google::Protobuf::Timestamp: seconds: 1744329215, nanos: 0>, dispatch_deadline: <Google::Protobuf::Duration: seconds: 600, nanos: 0>, dispatch_count: 0, response_count: 0, view: :BASIC> 

hibariya avatar Apr 11 '25 00:04 hibariya