13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/jobs/import_url_job.rb', line 13
def perform(file_set, log)
log.performing!
user = User.find_by_user_key(file_set.depositor)
Tempfile.open(file_set.id.tr('/', '_')) do |f|
copy_remote_file(file_set, f)
file_set.reload
if CurationConcerns::Actors::FileSetActor.new(file_set, user).create_content(f)
CurationConcerns.config.callback.run(:after_import_url_success, file_set, user)
log.success!
else
CurationConcerns.config.callback.run(:after_import_url_failure, file_set, user)
log.fail!(file_set.errors.full_messages.join(' '))
end
end
end
|