Class: Scry::ExportDownloader
- Inherits:
-
Object
- Object
- Scry::ExportDownloader
- Includes:
- Helpers, Sidekiq::Worker
- Defined in:
- lib/scry/sidekiq/workers/export_downloader.rb
Overview
Works on downloading an export.
Will attempt 5 times before giving up.
Instance Method Summary collapse
-
#perform(cookie_crumbs, course_url, download_url) ⇒ Object
Instigates downloading an export.
Methods included from Helpers
Instance Method Details
#perform(cookie_crumbs, course_url, download_url) ⇒ Object
Instigates downloading an export.
Creates a course from the cookies, then starts downloading the export.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/scry/sidekiq/workers/export_downloader.rb', line 25 def perform(, course_url, download_url) course = Course.(, course_url) uri = URI.parse(course_url) uri.path = download_url course.download_export(uri.to_s) write_log(Scry.export_download_good, course_url) rescue SocketError, Mechanize::Error, Net::HTTPClientError => e write_log( Scry.export_download_bad, "#{course_url} #{e.class} #{e.}", ) raise end |