From a8045a2ef9d906e05d36a7708672e176dc4a3f8a Mon Sep 17 00:00:00 2001 From: Chris Banks Date: Tue, 23 Apr 2024 12:46:42 +0100 Subject: [PATCH] Stop passing statsd (deprecated) to MQ client. search-api is the only app that's still using the optional statsd parameter to the govuk_message_queue_consumer constructor. We don't use statsd any more. This unblocks deleting the defunct code from govuk_message_queue_consumer. --- lib/tasks/message_queue.rake | 3 --- spec/unit/tasks/message_queue_spec.rb | 4 ---- 2 files changed, 7 deletions(-) diff --git a/lib/tasks/message_queue.rake b/lib/tasks/message_queue.rake index 9e24e9785..f2e755ebe 100644 --- a/lib/tasks/message_queue.rake +++ b/lib/tasks/message_queue.rake @@ -17,7 +17,6 @@ namespace :message_queue do GovukMessageQueueConsumer::Consumer.new( queue_name: "search_api_to_be_indexed", processor: Indexer::MessageProcessor.new, - statsd_client: Services.statsd_client, ).run end @@ -26,7 +25,6 @@ namespace :message_queue do GovukMessageQueueConsumer::Consumer.new( queue_name: "search_api_govuk_index", processor: GovukIndex::PublishingEventProcessor.new, - statsd_client: Services.statsd_client, ).run end @@ -35,7 +33,6 @@ namespace :message_queue do GovukMessageQueueConsumer::Consumer.new( queue_name: "search_api_bulk_reindex", processor: GovukIndex::PublishingEventProcessor.new, - statsd_client: Services.statsd_client, ).run end end diff --git a/spec/unit/tasks/message_queue_spec.rb b/spec/unit/tasks/message_queue_spec.rb index 9f2f07646..ce56da6a4 100644 --- a/spec/unit/tasks/message_queue_spec.rb +++ b/spec/unit/tasks/message_queue_spec.rb @@ -5,9 +5,6 @@ RSpec.describe Indexer::MessageProcessor, "RakeTest" do context "when indexing published documents to publishing-api" do it "use GovukMessageQueueConsumer::Consumer" do - statsd_client = Statsd.new - expect(Services).to receive(:statsd_client).and_return(statsd_client) - indexer = described_class.new expect(described_class).to receive(:new).and_return(indexer) @@ -18,7 +15,6 @@ .with( queue_name: "search_api_to_be_indexed", processor: indexer, - statsd_client:, ).and_return(consumer) Rake::Task["message_queue:listen_to_publishing_queue"].invoke