Skip to content

Commit 9777792

Browse files
committed
Share URL cache between materials/events in check_resource_urls task
1 parent 8b4e298 commit 9777792

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

lib/tasks/check_urls.rake

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,24 @@ namespace :tess do
77

88
desc 'Check material URLs for dead links'
99
task check_material_urls: :environment do
10-
check_materials
10+
puts 'Checking material URLs'
11+
LinkChecker.new.check(Material)
1112
end
1213

1314
desc 'Check event URLs for dead links'
1415
task check_event_urls: :environment do
15-
check_events
16+
puts 'Checking event URLs'
17+
LinkChecker.new.check(Event)
1618
end
1719

1820
desc 'Check event and material URLs for dead links'
1921
task check_resource_urls: :environment do
20-
check_materials
21-
check_events
22-
end
23-
end
22+
lc = LinkChecker.new
2423

25-
def check_materials
26-
puts 'Checking material URLs'
27-
LinkChecker.new.check(Material)
28-
end
24+
puts 'Checking material URLs'
25+
lc.check(Material)
2926

30-
def check_events
31-
puts 'Checking event URLs'
32-
LinkChecker.new.check(Event)
27+
puts 'Checking event URLs'
28+
lc.check(Event)
29+
end
3330
end

0 commit comments

Comments
 (0)