mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +08:00
Merge pull request #6385 from okriuchykhin/ok_SCI_9461
Fix file preview generation in projects export jobs [SCI-9461]
This commit is contained in:
commit
8e420181ac
1 changed files with 7 additions and 3 deletions
|
@ -194,13 +194,17 @@ class TeamZipExportJob < ZipExportJob
|
|||
file_data = preview.image.download
|
||||
else
|
||||
file_name = preview.blob.filename.to_s
|
||||
file_data = nil
|
||||
|
||||
begin
|
||||
ActiveRecord::Base.transaction(requires_new: true) do
|
||||
file_data = preview.processed.service.download(preview.key)
|
||||
# handle files not processable by Vips (no preview available) or missing
|
||||
rescue Vips::Error, ActiveStorage::FileNotFoundError
|
||||
return nil
|
||||
rescue Vips::Error, ActiveStorage::FileNotFoundError => e
|
||||
Rails.logger.error(e.message)
|
||||
Rails.logger.error(e.backtrace.join("\n"))
|
||||
raise ActiveRecord::Rollback
|
||||
end
|
||||
return nil if file_data.blank?
|
||||
end
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue