Skip to content

Commit 4075277

Browse files
fbacallCopilot
andauthored
Update lib/link_checker.rb
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b1a21ce commit 4075277

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/link_checker.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ def check(collection)
1515
def check_record(record)
1616
[record, *record.external_resources].each do |item|
1717
next if item.url.blank?
18-
@cache[item.url] ||= bad_response(item.url) # Cache the result, there could be multiple resources linked to same URL
19-
code = @cache[item.url]
18+
code = @cache.fetch(item.url) { bad_response(item.url) } # Cache the result, there could be multiple resources linked to same URL
2019
if code
2120
puts " #{code} - #{item.class.name} #{item.id}: #{item.url}" if log
2221
if item.link_monitor

0 commit comments

Comments
 (0)