Refactor:Use dev_to? to Check for DEV (#12083)
This commit is contained in:
parent
b94c95f164
commit
f4315489b2
5 changed files with 5 additions and 5 deletions
|
|
@ -13,7 +13,7 @@ class EmailDigest
|
|||
# Temporary
|
||||
# @sre:mstruve This is temporary until we have an efficient way to handle this job
|
||||
# for our large DEV community. Smaller Forems should be able to handle it no problem
|
||||
if SiteConfig.community_name == "DEV Community"
|
||||
if SiteConfig.dev_to?
|
||||
Emails::SendUserDigestWorker.new.perform(user.id)
|
||||
else
|
||||
Emails::SendUserDigestWorker.perform_async(user.id)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module Articles
|
|||
# Temporary
|
||||
# @sre:mstruve This is temporary until we have an efficient way to handle this job
|
||||
# for our large DEV community. Smaller Forems should be able to handle it no problem
|
||||
return if SiteConfig.community_name == "DEV Community"
|
||||
return if SiteConfig.dev_to?
|
||||
|
||||
if FeatureFlag.enabled?(:feeds_import)
|
||||
::Feeds::ImportArticlesWorker.perform_async
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module Emails
|
|||
# Temporary
|
||||
# @sre:mstruve This is temporary until we have an efficient way to handle this job
|
||||
# for our large DEV community. Smaller Forems should be able to handle it no problem
|
||||
return if SiteConfig.community_name == "DEV Community"
|
||||
return if SiteConfig.dev_to?
|
||||
|
||||
EmailDigest.send_periodic_digest_email
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ RSpec.describe EmailDigest, type: :service do
|
|||
end
|
||||
|
||||
it "performs job inline if community is DEV" do
|
||||
allow(SiteConfig).to receive(:community_name).and_return("DEV Community")
|
||||
allow(SiteConfig).to receive(:dev_to?).and_return(true)
|
||||
user = create(:user, email_digest_periodic: true)
|
||||
worker = Emails::SendUserDigestWorker.new
|
||||
allow(worker).to receive(:perform)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ RSpec.describe Articles::RssReaderWorker, type: :worker do
|
|||
end
|
||||
|
||||
it "short circuits if it's running on DEV" do
|
||||
allow(SiteConfig).to receive(:community_name).and_return("DEV Community")
|
||||
allow(SiteConfig).to receive(:dev_to?).and_return(true)
|
||||
allow(RssReader).to receive(:get_all_articles)
|
||||
allow(FeatureFlag).to receive(:enabled?)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue