Skip to content

Commit 87c52d7

Browse files
committed
remove notification service load test setting
closes CNVS-28905 test plan: message delivery should still work with or without the service Change-Id: I9207bd51d839029977988116ee95bb100f56160a Reviewed-on: https://gerrit.instructure.com/77700 Tested-by: Jenkins Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com> QA-Review: Gentry Beckmann <gbeckmann@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
1 parent df128dc commit 87c52d7

2 files changed

Lines changed: 5 additions & 25 deletions

File tree

app/models/message.rb

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,6 @@ def deliver
562562
end
563563

564564
if user && user.account.feature_enabled?(:notification_service) && path_type != "yo"
565-
if Setting.get("notification_service_traffic", nil).present?
566-
send(delivery_method)
567-
end
568565
enqueue_to_sqs
569566
else
570567
send(delivery_method)
@@ -582,7 +579,7 @@ def enqueue_to_sqs
582579
path_type,
583580
target
584581
)
585-
complete_dispatch if Setting.get("notification_service_traffic", nil).nil?
582+
complete_dispatch
586583
end
587584
rescue AWS::SQS::Errors::Base => e
588585
Canvas::Errors.capture(
@@ -591,12 +588,10 @@ def enqueue_to_sqs
591588
to: to,
592589
object: inspect.to_s
593590
)
594-
if Setting.get("notification_service_traffic", nil).nil?
595-
error_string = "Exception: #{e.class}: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
596-
self.transmission_errors = error_string
597-
self.errored_dispatch
598-
raise
599-
end
591+
error_string = "Exception: #{e.class}: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
592+
self.transmission_errors = error_string
593+
self.errored_dispatch
594+
raise
600595
end
601596

602597
class RemoteConfigurationError < StandardError; end

spec/lib/services/notification_service_spec.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@ module Services
8989
expect(@message.workflow_state).to eql("staged")
9090
end
9191

92-
it "will send to both services" do
93-
Setting.set("notification_service_traffic", "true")
94-
@queue.expects(:send_message).once
95-
@message.path_type = "email"
96-
@message.expects(:deliver_via_email).once
97-
expect{@message.deliver}.not_to raise_error
98-
end
99-
100-
it "does not restage if sending with both methods" do
101-
Setting.set("notification_service_traffic", "true")
102-
@queue.stubs(:send_message).raises(AWS::SQS::Errors::ServiceError)
103-
104-
expect{@message.deliver}.not_to raise_error
105-
end
106-
10792
context 'payload contents' do
10893
class SendMessageSpy
10994
attr_accessor :sent_hash

0 commit comments

Comments
 (0)