From 3534e115e5127f12292a84442b46ce93643c6d0d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 21 Aug 2017 17:32:41 +0200 Subject: Do not try to re-subscribe to unsubscribed accounts (#4653) --- app/services/subscribe_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/services/subscribe_service.rb') diff --git a/app/services/subscribe_service.rb b/app/services/subscribe_service.rb index d3e41e691..5617f98f4 100644 --- a/app/services/subscribe_service.rb +++ b/app/services/subscribe_service.rb @@ -2,7 +2,7 @@ class SubscribeService < BaseService def call(account) - return unless account.ostatus? + return if account.hub_url.blank? @account = account @account.secret = SecureRandom.hex -- cgit From 6b2be5dbfb73e2daf78cf050e5f24c2a8b31ece5 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 31 Aug 2017 06:44:00 -0700 Subject: Guarantee Subscription service first account has proper URL details (#4732) * Guarantee Subscription service first account has proper URL details Subscription Service potentially could break if the first user suspended themselves, creating a situation where the urls that populate throughout subscription service's PuSH request would cause the remote API to throw 503 errors. Guaranteeing that the first account picked is not suspended prevents this problem. * Fix style issue --- app/services/subscribe_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/services/subscribe_service.rb') diff --git a/app/services/subscribe_service.rb b/app/services/subscribe_service.rb index 5617f98f4..bfa7ff8c8 100644 --- a/app/services/subscribe_service.rb +++ b/app/services/subscribe_service.rb @@ -42,7 +42,7 @@ class SubscribeService < BaseService end def some_local_account - @some_local_account ||= Account.local.first + @some_local_account ||= Account.local.where(suspended: false).first end # Any response in the 3xx or 4xx range, except for 429 (rate limit) -- cgit