From 47b92339f1e2dba77ef9e448f3ac4b13c7dabd72 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 9 Jul 2024 12:04:28 -0300 Subject: [PATCH] Improve comments --- .github/workflows/judoscale-good_job-test.yml | 2 +- judoscale-good_job/test/metrics_collector_test.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/judoscale-good_job-test.yml b/.github/workflows/judoscale-good_job-test.yml index 5a4a20db..d36ab30b 100644 --- a/.github/workflows/judoscale-good_job-test.yml +++ b/.github/workflows/judoscale-good_job-test.yml @@ -28,7 +28,7 @@ jobs: ruby: "2.6" - gemfile: Gemfile-activerecord-7-0 ruby: "2.6" - # GoodJob v4+ dropped support to Ruby 2.6/2.7, we test it against these Gemfiles. + # GoodJob v4+ dropped support for Ruby 2.6/2.7, we test it against these Gemfiles. - gemfile: Gemfile ruby: "2.7" - gemfile: Gemfile-activerecord-7-0 diff --git a/judoscale-good_job/test/metrics_collector_test.rb b/judoscale-good_job/test/metrics_collector_test.rb index 8f5cf688..a9510fa9 100644 --- a/judoscale-good_job/test/metrics_collector_test.rb +++ b/judoscale-good_job/test/metrics_collector_test.rb @@ -145,8 +145,8 @@ def clear_enqueued_jobs Delayable.set(queue: "default").perform_later metrics = nil ::GoodJob::JobPerformer.new("default").next do |execution| - # GoodJob v3 queries `GoodJob::Execution.running` scope, which uses `performed_at` in the condition, - # so we set it here. v4 uses `GoodJob::Job.running` scope, joined with the advisory lock instead. + # Support GoodJob v3 query/scope `GoodJob::Execution.running`, which filters by `performed_at`. + # v4 scope `GoodJob::Job.running` joins with the advisory lock created by `JobPerformer#next` instead. execution.update!(performed_at: Time.now.utc) metrics = subject.collect @@ -164,8 +164,8 @@ def clear_enqueued_jobs use_adapter_config :good_job, track_busy_jobs: true do Delayable.set(queue: "default").perform_later ::GoodJob::JobPerformer.new("default").next do |execution| - # GoodJob v3 queries `GoodJob::Execution.running` scope, which uses `performed_at` in the condition, - # so we set it here. v4 uses `GoodJob::Job.running` scope, joined with the advisory lock instead. + # Support GoodJob v3 query/scope `GoodJob::Execution.running`, which filters by `performed_at`. + # v4 scope `GoodJob::Job.running` joins with the advisory lock created by `JobPerformer#next` instead. execution.update!(performed_at: Time.now.utc) subject.collect