`domain_exists` -> `domain_exists?`
parent
a2b9ac9a48
commit
cd52f75006
|
@ -61,7 +61,7 @@ module ModerationHelper
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain_exists(domain)
|
def domain_exists?(domain)
|
||||||
begin
|
begin
|
||||||
code = Request.new(:head, "https://#{domain}").perform(&:code)
|
code = Request.new(:head, "https://#{domain}").perform(&:code)
|
||||||
rescue
|
rescue
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Scheduler::JanitorScheduler
|
||||||
def import_blocklists!
|
def import_blocklists!
|
||||||
blocks = merged_blocklist.reject { |entry| entry[:domain].in?(@exclude_domains) }
|
blocks = merged_blocklist.reject { |entry| entry[:domain].in?(@exclude_domains) }
|
||||||
blocks.each do |entry|
|
blocks.each do |entry|
|
||||||
next unless domain_exists(entry[:domain])
|
next unless domain_exists?(entry[:domain])
|
||||||
block = DomainBlock.create!(entry)
|
block = DomainBlock.create!(entry)
|
||||||
DomainBlockWorker.perform_async(block)
|
DomainBlockWorker.perform_async(block)
|
||||||
Admin::ActionLog.create(account: @account, action: :create, target: block)
|
Admin::ActionLog.create(account: @account, action: :create, target: block)
|
||||||
|
|
Loading…
Reference in New Issue